Exemplo n.º 1
0
 /**
  * @dataProvider instanceProvider
  */
 public function testToArrayMore(DiffOpRemove $diffOp)
 {
     $array = $diffOp->toArray();
     $this->assertArrayHasKey('oldvalue', $array);
 }
Exemplo n.º 2
0
 private function applyDiffOpRemove(&$base, $key, DiffOpRemove $diffOp)
 {
     if (!array_key_exists($key, $base)) {
         $this->handleError('Cannot do a non-add operation with an element not present in a map');
         return;
     }
     if (!$this->valuesAreEqual($base[$key], $diffOp->getOldValue())) {
         $this->handleError('Tried removing a map value that mismatches the current value');
         return;
     }
     unset($base[$key]);
 }