/** * @dataProvider instanceProvider */ public function testGetNewValue(DiffOpRemove $diffOp, array $constructorArgs) { $this->assertEquals($constructorArgs[0], $diffOp->getOldValue()); }
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]); }