test/snac/server/ServerTest.php
/**
     * Test Reading a constellation from the server
     * @param \snac\data\Constellation $c The Constellation object from testInsertConstellation
     * @depends testInsertConstellation
     */
Test Reading a constellation from the server
@param \snac\data\Constellation $c The Constellation object from testInsertConstellation
@depends testInsertConstellation
Test Reading a constellation from the server @param \ snac \ data \ Constellation $c The Constellation object from testInsertConstellation @depends testInsertConstellation
public function testReadConstellation(\snac\data\Constellation $c) {
        if ($c == null) {
            $this->fail("Depends on insert constellation");
        }
        $server = new Server( array(
                "command" => "read",
                "user" => $this->user->toArray(),
                "constellationid" => $c->getID(),
                "version" => $c->getVersion()
        ));
        $server->run();
        $response = $server->getResponse();
        $this->assertNotNull($response);
        $response = json_decode($response, true);
        $this->assertArrayHasKey("constellation", $response);
        $read = new \snac\data\Constellation($response["constellation"]);
        $this->assertTrue($read->equals($c, false), "Read copy is not equal to original");
        return $read;
    }
public function testReadConstellation ( \ snac \ data \ Constellation $ c ) { if ( $ c == null ) { $ this -> fail ( " Depends on insert constellation " ) ; } $ server = new Server ( array ( " command " => " read " , " user " => $ this -> user -> toArray ( ) , " constellationid " => $ c -> getID ( ) , " version " => $ c -> getVersion ( ) ) ) ; $ server -> run ( ) ; $ response = $ server -> getResponse ( ) ; $ this -> assertNotNull ( $ response ) ; $ response = json_decode ( $ response , true ) ; $ this -> assertArrayHasKey ( " constellation " , $ response ) ; $ read = new \ snac \ data \ Constellation ( $ response [ " constellation " ] ) ; $ this -> assertTrue ( $ read -> equals ( $ c , false ) , " Read copy is not equal to original " ) ; return $ read ; }
Test Reading a constellation from the server
 @param \snac\data\Constellation $c The Constellation object from testInsertConstellation
 @depends testInsertConstellation
Test Reading a constellation from the server @param \ snac \ data \ Constellation $c The Constellation object from testInsertConstellation @depends testInsertConstellation