test/snac/data/ConstellationTest.php
/**
     * Test that equals() can ignore metadata
     */
Test that equals() can ignore metadata
Test that equals () can ignore metadata
public function testEqualsCanIgnoreMetadata() {
         $id1 = new \snac\data\Constellation();
         $id2 = new \snac\data\Constellation();
         $jsonIn = file_get_contents("test/snac/data/json/constellation_test.json");
         $id1->fromJSON($jsonIn);
         $id2->fromJSON($jsonIn);
         $data = array("dataType"   => "SNACControlMetadata",
                       "sourceData" => "University of Virginia",
                       "language"   => "Spanish",
                       "note"       => "This is a mocked metadata");
         $metadata = new \snac\data\SNACControlMetadata($data);
         $id1->addSNACControlMetadata($metadata);
         $this->assertFalse($id1->equals($id2), "Equals failed to compare SNACControlMetadata by default");
         $this->assertTrue($id1->equals($id2, false, false), "Equals failed to ignore SNACControlMetadata");
     }
public function testEqualsCanIgnoreMetadata ( ) { $ id1 = new \ snac \ data \ Constellation ( ) ; $ id2 = new \ snac \ data \ Constellation ( ) ; $ jsonIn = file_get_contents ( " test/snac/data/json/constellation_test.json " ) ; $ id1 -> fromJSON ( $ jsonIn ) ; $ id2 -> fromJSON ( $ jsonIn ) ; $ data = array ( " dataType " => " SNACControlMetadata " , " sourceData " => " University of Virginia " , " language " => " Spanish " , " note " => " This is a mocked metadata " ) ; $ metadata = new \ snac \ data \ SNACControlMetadata ( $ data ) ; $ id1 -> addSNACControlMetadata ( $ metadata ) ; $ this -> assertFalse ( $ id1 -> equals ( $ id2 ) , " Equals failed to compare SNACControlMetadata by default " ) ; $ this -> assertTrue ( $ id1 -> equals ( $ id2 , false , false ) , " Equals failed to ignore SNACControlMetadata " ) ; }
Test that equals() can ignore metadata
Test that equals () can ignore metadata