Skip to content

Commit

Permalink
Add numeric string failing test for StringEndsWith
Browse files Browse the repository at this point in the history
  • Loading branch information
guilliamxavier authored and sebastianbergmann committed Feb 15, 2019
1 parent 5a0e625 commit 64df74a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/unit/Framework/Constraint/StringEndsWithTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,31 @@ class StringEndsWithTest extends ConstraintTestCase
public function testConstraintStringEndsWithCorrectValueAndReturnResult(): void
{
$constraint = new StringEndsWith('suffix');

$this->assertTrue($constraint->evaluate('foosuffix', '', true));
}

public function testConstraintStringEndsWithNotCorrectValueAndReturnResult(): void
{
$constraint = new StringEndsWith('suffix');

$this->assertFalse($constraint->evaluate('suffixerror', '', true));
}

public function testConstraintStringEndsWithCorrectNumericValueAndReturnResult(): void
{
$constraint = new StringEndsWith('0E1');

$this->assertTrue($constraint->evaluate('zzz0E1', '', true));
}

public function testConstraintStringEndsWithNotCorrectNumericValueAndReturnResult(): void
{
$constraint = new StringEndsWith('0E1');

$this->assertFalse($constraint->evaluate('zzz0E2', '', true));
}

public function testConstraintStringEndsWithToStringMethod(): void
{
$constraint = new StringEndsWith('suffix');
Expand Down

0 comments on commit 64df74a

Please sign in to comment.