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'); }
/** * @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)); }