/** * @dataProvider resultsCompareProvider * @covers \Tests\Util::compareResults */ public function testCompareResults($expectedResult, $actualResult, $compareString) { $this->assertSame($compareString, Util::compareResults($expectedResult, $actualResult)); }
/** * @covers \Tests\Constraint\ResultsMatch::failureDescription */ public function testFailAndFailureDescription() { $expected = new Result(); $other = Result::factory(array(new Token('Foo'))); $resultsMatch = new ResultsMatch($expected); $message = 'Failed asserting that Results do not match: ' . PHP_EOL . 'Cause: length' . PHP_EOL . Util::compareResults($expected, $other) . '.'; try { $resultsMatch->evaluate($other, ''); $this->fail('no exception thrown'); } catch (\PHPUnit_Framework_ExpectationFailedException $e) { $this->assertEquals($message, $e->getMessage()); } }
/** * @param mixed $other * @param string $description * @param boolean $not * @return string */ protected function failureDescription($other) { return 'Results do not match: ' . PHP_EOL . 'Cause: ' . $this->_cause . PHP_EOL . Util::compareResults($this->_expectedResult, $other); }