compare() public method

public compare ( $expected, $actual )
 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');
 }
Example #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));
 }