first commit
This commit is contained in:
30
vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/MatchesPatternTest.php
vendored
Normal file
30
vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/MatchesPatternTest.php
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace Hamcrest\Text;
|
||||
|
||||
class MatchesPatternTest extends \Hamcrest\AbstractMatcherTest
|
||||
{
|
||||
|
||||
protected function createMatcher()
|
||||
{
|
||||
return matchesPattern('/o+b/');
|
||||
}
|
||||
|
||||
public function testEvaluatesToTrueIfArgumentmatchesPattern()
|
||||
{
|
||||
assertThat('foobar', matchesPattern('/o+b/'));
|
||||
assertThat('foobar', matchesPattern('/^foo/'));
|
||||
assertThat('foobar', matchesPattern('/ba*r$/'));
|
||||
assertThat('foobar', matchesPattern('/^foobar$/'));
|
||||
}
|
||||
|
||||
public function testEvaluatesToFalseIfArgumentDoesntMatchRegex()
|
||||
{
|
||||
assertThat('foobar', not(matchesPattern('/^foob$/')));
|
||||
assertThat('foobar', not(matchesPattern('/oobe/')));
|
||||
}
|
||||
|
||||
public function testHasAReadableDescription()
|
||||
{
|
||||
$this->assertDescription('a string matching "pattern"', matchesPattern('pattern'));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user