Пример #1
0
 /**
  * Checks that ItemDiff can handle atomic diffs for substructures.
  * This is needed for backwards compatibility with old versions of
  * MapDiffer: As of commit ff65735a125e, MapDiffer may generate atomic
  * diffs for substructures even in recursive mode (bug 51363).
  */
 public function testAtomicSubstructureWorkaround()
 {
     $oldErrorLevel = error_reporting(E_USER_ERROR);
     $atomicListDiff = new DiffOpChange(array('a' => 'A', 'b' => 'B'), array('b' => 'B', 'a' => 'A'));
     $diff = new ItemDiff(array('aliases' => $atomicListDiff, 'label' => $atomicListDiff, 'description' => $atomicListDiff, 'claim' => $atomicListDiff, 'links' => $atomicListDiff));
     $this->assertInstanceOf('Diff\\DiffOp\\Diff\\Diff', $diff->getAliasesDiff());
     $this->assertInstanceOf('Diff\\DiffOp\\Diff\\Diff', $diff->getLabelsDiff());
     $this->assertInstanceOf('Diff\\DiffOp\\Diff\\Diff', $diff->getDescriptionsDiff());
     $this->assertInstanceOf('Diff\\DiffOp\\Diff\\Diff', $diff->getClaimsDiff());
     $this->assertInstanceOf('Diff\\DiffOp\\Diff\\Diff', $diff->getSiteLinkDiff());
     error_reporting($oldErrorLevel);
 }