/** * tests computation of a records differences described by a set of modification logs */ public function testComputeDiff() { $diffs = $this->_modLogClass->computeDiff($this->_persistantLogEntries)->toArray(); $this->assertEquals(2, count($diffs)); // we changed two attributes foreach ($diffs as $diff) { switch ($diff['modified_attribute']) { case 'FirstTestAttribute': $this->assertEquals('Hamburg', $diff['old_value']); $this->assertEquals('Stuttgart', $diff['new_value']); break; case 'SecondTestAttribute': $this->assertEquals('Deutschland', $diff['old_value']); $this->assertEquals('Italien', $diff['new_value']); } } }