Skip to content

Commit

Permalink
Re-add a test for #2907 (lost in commit d0dab53)
Browse files Browse the repository at this point in the history
  • Loading branch information
guilliamxavier authored and sebastianbergmann committed Aug 31, 2018
1 parent 14681a7 commit b6f73db
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/Framework/Constraint/StringMatchesFormatDescriptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,16 @@ public function testConstraintStringMatchesCharacter(): void
$this->assertCount(1, $constraint);
}

public function testConstraintStringMatchesEscapedPercent(): void
{
$constraint = new StringMatchesFormatDescription('%%,%%e,%%s,%%S,%%a,%%A,%%w,%%i,%%d,%%x,%%f,%%c,%%Z,%%%%,%%');

$this->assertFalse($constraint->evaluate('%%,%' . \DIRECTORY_SEPARATOR . ',%*,%*,%*,%*,% ,%0,%0,%0f0f0f,%1.0,%*,%%Z,%%%%,%%', '', true));
$this->assertTrue($constraint->evaluate('%,%e,%s,%S,%a,%A,%w,%i,%d,%x,%f,%c,%Z,%%,%', '', true));
$this->assertEquals('matches PCRE pattern "/^%,%e,%s,%S,%a,%A,%w,%i,%d,%x,%f,%c,%Z,%%,%$/s"', $constraint->toString());
$this->assertCount(1, $constraint);
}

public function testConstraintStringMatchesSlash(): void
{
$constraint = new StringMatchesFormatDescription('/');
Expand Down

0 comments on commit b6f73db

Please sign in to comment.