From 5a0e6253a951ae9042ee82aad7e1e21c129d4ac0 Mon Sep 17 00:00:00 2001 From: Guilliam Xavier Date: Fri, 1 Feb 2019 11:35:13 +0100 Subject: [PATCH] Add numeric string test for StringStartsWith --- .../Constraint/StringStartsWithTest.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/unit/Framework/Constraint/StringStartsWithTest.php b/tests/unit/Framework/Constraint/StringStartsWithTest.php index 37a91c47cad..28dec536c37 100644 --- a/tests/unit/Framework/Constraint/StringStartsWithTest.php +++ b/tests/unit/Framework/Constraint/StringStartsWithTest.php @@ -28,6 +28,20 @@ public function testConstraintStringStartsWithNotCorrectValueAndReturnResult(): $this->assertFalse($constraint->evaluate('error', '', true)); } + public function testConstraintStringStartsWithCorrectNumericValueAndReturnResult(): void + { + $constraint = new StringStartsWith('0E1'); + + $this->assertTrue($constraint->evaluate('0E1zzz', '', true)); + } + + public function testConstraintStringStartsWithNotCorrectNumericValueAndReturnResult(): void + { + $constraint = new StringStartsWith('0E1'); + + $this->assertFalse($constraint->evaluate('0E2zzz', '', true)); + } + public function testConstraintStringStartsWithToStringMethod(): void { $constraint = new StringStartsWith('prefix'); @@ -73,7 +87,8 @@ public function testConstraintStringStartsWithNotCorrectValueExceptionAndCustomM } catch (ExpectationFailedException $e) { $this->assertEquals( <<