/** * @dataProvider provideConstruction * * @param EntityDiff $entityDiff * @param Diff $redirectDiff */ public function testConstruction(EntityDiff $entityDiff, Diff $redirectDiff) { $diff = new EntityContentDiff($entityDiff, $redirectDiff); $this->assertArrayEquals($entityDiff->getOperations(), $diff->getEntityDiff()->getOperations()); $this->assertEmpty(array_diff(array_keys($entityDiff->getOperations()), array_keys($diff->getEntityDiff()->getOperations()))); $this->assertArrayEquals($redirectDiff->getOperations(), $diff->getRedirectDiff()->getOperations()); $this->assertEmpty(array_diff(array_keys($redirectDiff->getOperations()), array_keys($diff->getRedirectDiff()->getOperations()))); }
/** * @param EntityDiff $entityDiff * @param Diff $redirectDiff */ public function __construct(EntityDiff $entityDiff, Diff $redirectDiff) { $operations = array(); $this->entityDiff = $entityDiff; $this->redirectDiff = $redirectDiff; $operations = array_merge($operations, $this->entityDiff->getOperations()); $operations = array_merge($operations, $this->redirectDiff->getOperations()); parent::__construct($operations, true); }