Inheritance: extends Matcher
コード例 #1
0
 public function test_error_when_path_in_nested_value_does_not_exist()
 {
     $value = json_encode(array('foo' => array('bar' => array())));
     $pattern = json_encode(array('foo' => array('bar' => array('faz' => 'faz value'))));
     $this->assertFalse($this->matcher->match($value, $pattern));
     $this->assertEquals($this->matcher->getError(), 'There is no element under path [foo][bar][faz] in value.');
 }
コード例 #2
0
ファイル: JsonMatcherTest.php プロジェクト: coduo/php-matcher
 public function test_error_when_json_value_is_invalid()
 {
     $value = '{"test": "value",}';
     $pattern = '{"test": "@string@"}';
     $this->assertFalse($this->matcher->match($value, $pattern));
     $this->assertEquals($this->matcher->getError(), 'Invalid given JSON of value. Syntax error, malformed JSON');
 }