Example #1
0
 private function patchMapOrList(array $base, Diff $diff)
 {
     if ($diff->looksAssociative()) {
         $base = $this->patch($base, $diff);
     } else {
         $base = $this->listPatcher->patch($base, $diff);
     }
     return $base;
 }
Example #2
0
 /**
  * @dataProvider patchProvider
  *
  * @param Patcher $patcher
  * @param array $base
  * @param Diff $diff
  * @param array $expected
  */
 public function testPatch(Patcher $patcher, array $base, Diff $diff, array $expected)
 {
     $actual = $patcher->patch($base, $diff);
     $this->assertArrayEquals($expected, $actual);
 }