Inheritance: implements PhpSpec\Formatter\Presenter\Differ\DifferEngine
Ejemplo n.º 1
0
 function it_converts_objects_to_string_and_diffs_the_result(Exporter $exporter, StringEngine $stringDiffer)
 {
     $exporter->export(Argument::type('DateTime'))->willReturn('DateTime');
     $exporter->export(Argument::type('ArrayObject'))->willReturn('ArrayObject');
     $stringDiffer->compare('DateTime', 'ArrayObject')->willReturn('-DateTime+ArrayObject');
     $diff = $this->compare(new \DateTime(), new \ArrayObject());
     $diff->shouldBe('-DateTime+ArrayObject');
 }
Ejemplo n.º 2
0
 /**
  * @param object $expected
  * @param object $actual
  *
  * @return string
  */
 public function compare($expected, $actual)
 {
     return $this->stringDiffer->compare($this->exporter->export($expected), $this->exporter->export($actual));
 }