public function testMessage($compare) { if ($this->test($compare)) { return 'Equal expectation [' . $this->dumper->describeValue($this->value) . ']'; } else { return 'Equal expectation fails ' . $this->dumper->describeDifference($this->value, $compare); } }
function testNestedHash() { $tree = new EqualExpectation(array("a" => 1, "b" => array("c" => 2, "d" => "Three"))); $this->assertPattern('/member.*?\\[b\\].*?\\[d\\].*?at character 5/', $tree->testMessage(array("a" => 1, "b" => array("c" => 2, "d" => "Threeish")))); }