test/snac/data/ConstellationTest.php
/**
     * Test that reading a JSON object over another object will replace that object
     */
Test that reading a JSON object over another object will replace that object
Test that reading a JSON object over another object will replace that object
public function testJSONOverwrite() {
        $identity = new \snac\data\Constellation();
        $identity2 = new \snac\data\Constellation();
        $jsonIn1 = file_get_contents("test/snac/data/json/constellation_test.json");
        $jsonIn2 = file_get_contents("test/snac/data/json/constellation_test2.json");
        $identity->fromJSON($jsonIn1);
        $identity2->fromJSON($jsonIn2);
        $identity2->fromJSON($jsonIn1);
        $this->assertEquals($identity->toJSON(), $identity2->toJSON());
    }
public function testJSONOverwrite ( ) { $ identity = new \ snac \ data \ Constellation ( ) ; $ identity2 = new \ snac \ data \ Constellation ( ) ; $ jsonIn1 = file_get_contents ( " test/snac/data/json/constellation_test.json " ) ; $ jsonIn2 = file_get_contents ( " test/snac/data/json/constellation_test2.json " ) ; $ identity -> fromJSON ( $ jsonIn1 ) ; $ identity2 -> fromJSON ( $ jsonIn2 ) ; $ identity2 -> fromJSON ( $ jsonIn1 ) ; $ this -> assertEquals ( $ identity -> toJSON ( ) , $ identity2 -> toJSON ( ) ) ; }
Test that reading a JSON object over another object will replace that object
Test that reading a JSON object over another object will replace that object
// Works instead of equals() in this controlled environment //$this->assertTrue($identity->equals($identity2));