Пример #1
0
 public function test_error_description_when_any_matcher_can_match()
 {
     $this->firstMatcher->expects($this->once())->method('canMatch')->will($this->returnValue(false));
     $this->secondMatcher->expects($this->once())->method('canMatch')->will($this->returnValue(false));
     $this->assertEquals($this->matcher->match('foo', 'foo_pattern'), false);
     $this->assertEquals($this->matcher->getError(), 'Any matcher from chain can\'t match value "foo" to pattern "foo_pattern"');
 }
Пример #2
0
 public function test_error_message_when_matching_non_array_value()
 {
     $this->assertFalse($this->matcher->match(new \DateTime(), "@array@"));
     $this->assertEquals($this->matcher->getError(), "object \"\\DateTime\" is not a valid array.");
 }