public function testGivenEntityDiffOpArray_entityDiffOpisReturned() { $factory = new EntityTypeAwareDiffOpFactory(); $diffOp = new ItemDiff(array()); $newDiffOp = $factory->newFromArray($diffOp->toArray()); $this->assertEquals($diffOp, $newDiffOp); }
/** * @see ChangeRow::unserializeInfo() * * Overwritten to use the array representation of the diff. * * @since 0.4 * @param string $str * @return array the info array */ public function unserializeInfo($str) { static $factory = null; if ($factory == null) { $factory = new EntityTypeAwareDiffOpFactory(array($this, 'objectifyArrays')); } $info = parent::unserializeInfo($str); if (isset($info['diff']) && is_array($info['diff'])) { $info['diff'] = $factory->newFromArray($info['diff']); } return $info; }