Ejemplo n.º 1
0
 public function testMatchWithNonMatchingValue()
 {
     $pattern = new Pattern('foo*bar.ba[zr]?');
     $this->assertFalse($pattern->match('foo.bar-bazz'));
     $this->assertFalse($pattern->match('foo bar.baaz'));
     $this->assertFalse($pattern->match('foo.bar.baz'));
 }
Ejemplo n.º 2
0
 public function testMatch()
 {
     $regex = '#^foo.*bar$#u';
     $this->compiler->expects($this->once())->method('compile')->with($this->patternValue)->will($this->returnValue($regex));
     $this->assertTrue($this->pattern->match('foo-bar'));
     $this->assertFalse($this->pattern->match('-foo-bar'));
     $this->assertFalse($this->pattern->match('foo-bar-'));
 }