/** * @dataProvider elementInstancesProvider * @param DiffOp[] $operations */ public function testGetRemovals(array $operations) { $diff = new Diff($operations, true); $removals = array(); foreach ($operations as $operation) { if ($operation->getType() == 'remove') { $removals[] = $operation; } } $this->assertArrayEquals($removals, $diff->getRemovals()); }
private function isAttemptToModifyNotExistingElement($base, $key, Diff $diffOp) { return !array_key_exists($key, $base) && ($diffOp->getChanges() !== array() || $diffOp->getRemovals() !== array()); }