Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit f3a51e0

Browse files
committed
chore: added empty string comparison tests
1 parent 8b84f12 commit f3a51e0

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

tests/GreaterThanOrEqualTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public static function provideRuleFailureConditionData(): \Generator
4141
yield 'float' => [new GreaterThanOrEqual(10.0), 1.0, $exception, $message];
4242
yield 'int with float' => [new GreaterThanOrEqual(10), 1.0, $exception, $message];
4343
yield 'string' => [new GreaterThanOrEqual('z'), 'a', $exception, $message];
44+
yield 'empty string' => [new GreaterThanOrEqual('a'), '', $exception, $message];
4445
}
4546

4647
public static function provideRuleSuccessConditionData(): \Generator
@@ -57,6 +58,8 @@ public static function provideRuleSuccessConditionData(): \Generator
5758
yield 'same int with float' => [new GreaterThanOrEqual(10), 10.0];
5859
yield 'string' => [new GreaterThanOrEqual('a'), 'z'];
5960
yield 'same string' => [new GreaterThanOrEqual('a'), 'a'];
61+
yield 'empty string' => [new GreaterThanOrEqual(''), 'a'];
62+
yield 'same empty string' => [new GreaterThanOrEqual(''), ''];
6063
}
6164

6265
public static function provideRuleMessageOptionData(): \Generator

tests/GreaterThanTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public static function provideRuleFailureConditionData(): \Generator
4747
yield 'same int with float' => [new GreaterThan(10), 10.0, $exception, $message];
4848
yield 'string' => [new GreaterThan('z'), 'a', $exception, $message];
4949
yield 'same string' => [new GreaterThan('a'), 'a', $exception, $message];
50+
yield 'empty string' => [new GreaterThan('a'), '', $exception, $message];
51+
yield 'same empty string' => [new GreaterThan(''), '', $exception, $message];
5052
}
5153

5254
public static function provideRuleSuccessConditionData(): \Generator
@@ -57,6 +59,7 @@ public static function provideRuleSuccessConditionData(): \Generator
5759
yield 'float' => [new GreaterThan(10.0), 20.0];
5860
yield 'int with float' => [new GreaterThan(10), 20.0];
5961
yield 'string' => [new GreaterThan('a'), 'z'];
62+
yield 'empty string' => [new GreaterThan(''), 'a'];
6063
}
6164

6265
public static function provideRuleMessageOptionData(): \Generator

tests/LessThanOrEqualTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public static function provideRuleFailureConditionData(): \Generator
4141
yield 'float' => [new LessThanOrEqual(10.0), 20.0, $exception, $message];
4242
yield 'int with float' => [new LessThanOrEqual(10), 20.0, $exception, $message];
4343
yield 'string' => [new LessThanOrEqual('a'), 'z', $exception, $message];
44+
yield 'empty string' => [new LessThanOrEqual(''), 'a', $exception, $message];
4445
}
4546

4647
public static function provideRuleSuccessConditionData(): \Generator
@@ -57,6 +58,8 @@ public static function provideRuleSuccessConditionData(): \Generator
5758
yield 'same int with float' => [new LessThanOrEqual(10), 10.0];
5859
yield 'string' => [new LessThanOrEqual('z'), 'a'];
5960
yield 'same string' => [new LessThanOrEqual('a'), 'a'];
61+
yield 'empty string' => [new LessThanOrEqual('a'), ''];
62+
yield 'same empty string' => [new LessThanOrEqual(''), ''];
6063
}
6164

6265
public static function provideRuleMessageOptionData(): \Generator

tests/LessThanTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public static function provideRuleFailureConditionData(): \Generator
4747
yield 'same int with float' => [new LessThan(10), 10.0, $exception, $message];
4848
yield 'string' => [new LessThan('a'), 'z', $exception, $message];
4949
yield 'same string' => [new LessThan('a'), 'a', $exception, $message];
50+
yield 'empty string' => [new LessThan(''), 'a', $exception, $message];
51+
yield 'same empty string' => [new LessThan(''), '', $exception, $message];
5052
}
5153

5254
public static function provideRuleSuccessConditionData(): \Generator
@@ -57,6 +59,7 @@ public static function provideRuleSuccessConditionData(): \Generator
5759
yield 'float' => [new LessThan(10.0), 1.0];
5860
yield 'int with float' => [new LessThan(10), 1.0];
5961
yield 'string' => [new LessThan('z'), 'a'];
62+
yield 'empty string' => [new LessThan('a'), ''];
6063
}
6164

6265
public static function provideRuleMessageOptionData(): \Generator

0 commit comments

Comments
 (0)