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