test/snac/data/ConstellationTest.php
/**
     * Test that reading a larger JSON object multiple times does not result in memory error
     */
Test that reading a larger JSON object multiple times does not result in memory error
Test that reading a larger JSON object multiple times does not result in memory error
public function testJSONExtreme() {
        $identity = new \snac\data\Constellation();
        $jsonIn = file_get_contents("test/snac/data/json/constellation_test2.json");
        $identity->fromJSON($jsonIn);
        unset($jsonIn);
        for ($i = 0; $i < 10; $i++) {
            $identity2 = new \snac\data\Constellation();
            $jsonIn = file_get_contents("test/snac/data/json/constellation_test2.json");
            $identity2->fromJSON($jsonIn);
            unset($jsonIn);
            $this->assertEquals($identity->toJSON(), $identity2->toJSON());
        }
    }
public function testJSONExtreme ( ) { $ identity = new \ snac \ data \ Constellation ( ) ; $ jsonIn = file_get_contents ( " test/snac/data/json/constellation_test2.json " ) ; $ identity -> fromJSON ( $ jsonIn ) ; unset ( $ jsonIn ) ; for ( $ i = 0 ; $ i < 10 ; $ i ++ ) { $ identity2 = new \ snac \ data \ Constellation ( ) ; $ jsonIn = file_get_contents ( " test/snac/data/json/constellation_test2.json " ) ; $ identity2 -> fromJSON ( $ jsonIn ) ; unset ( $ jsonIn ) ; $ this -> assertEquals ( $ identity -> toJSON ( ) , $ identity2 -> toJSON ( ) ) ; } }
Test that reading a larger JSON object multiple times does not result in memory error
Test that reading a larger JSON object multiple times does not result in memory error
// Works instead of equals() in this controlled environment //$this->assertTrue($identity->equals($identity2));