Skip to content

Commit

Permalink
Add numeric string test for StringStartsWith
Browse files Browse the repository at this point in the history
  • Loading branch information
guilliamxavier authored and sebastianbergmann committed Feb 15, 2019
1 parent 92ed8b4 commit 5a0e625
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/unit/Framework/Constraint/StringStartsWithTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -73,7 +87,8 @@ public function testConstraintStringStartsWithNotCorrectValueExceptionAndCustomM
} catch (ExpectationFailedException $e) {
$this->assertEquals(
<<<EOF
custom message\nFailed asserting that 'error' starts with "prefix".
custom message
Failed asserting that 'error' starts with "prefix".
EOF
,
Expand Down

0 comments on commit 5a0e625

Please sign in to comment.