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