Ejemplo n.º 1
0
 /**
  * @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());
 }
Ejemplo n.º 2
0
 private function isAttemptToModifyNotExistingElement($base, $key, Diff $diffOp)
 {
     return !array_key_exists($key, $base) && ($diffOp->getChanges() !== array() || $diffOp->getRemovals() !== array());
 }