public function testGivenNormalDiffOpArray_diffOpIsReturned()
 {
     $factory = new EntityTypeAwareDiffOpFactory();
     $diffOp = new DiffOpAdd(42);
     $newDiffOp = $factory->newFromArray($diffOp->toArray());
     $this->assertEquals($diffOp, $newDiffOp);
 }
Exemplo n.º 2
0
 private function applyDiffOpAdd(&$base, $key, DiffOpAdd $diffOp)
 {
     if (array_key_exists($key, $base)) {
         $this->handleError('Cannot add an element already present in a map');
         return;
     }
     $base[$key] = $diffOp->getNewValue();
 }
Exemplo n.º 3
0
 /**
  * @dataProvider instanceProvider
  */
 public function testToArrayMore(DiffOpAdd $diffOp)
 {
     $array = $diffOp->toArray();
     $this->assertArrayHasKey('newvalue', $array);
 }