test/snac/server/ServerTest.php
/**
     * Tests getting user information from the server
     */
Tests getting user information from the server
Tests getting user information from the server
public function testUserInformation() {
        $server = new Server( array(
                "command" => "user_information"
        ));
        $server->run();
        $response = $server->getResponse();
        $this->assertNotNull($response);
        $response = json_decode($response, true);
        $this->assertEquals("failure", $response["result"]);
        $server = new Server( array(
                "command" => "user_information",
                "user" => $this->user->toArray()
        ));
        $server->run();
        $response = $server->getResponse();
        $this->assertNotNull($response);
        $response = json_decode($response, true);
        $this->assertEquals("success", $response["result"]);
        $this->assertArrayHasKey("user", $response);
        $this->assertArrayHasKey("editing", $response);
        $this->assertArrayHasKey("editing_lock", $response);
    }
public function testUserInformation ( ) { $ server = new Server ( array ( " command " => " user_information " ) ) ; $ server -> run ( ) ; $ response = $ server -> getResponse ( ) ; $ this -> assertNotNull ( $ response ) ; $ response = json_decode ( $ response , true ) ; $ this -> assertEquals ( " failure " , $ response [ " result " ] ) ; $ server = new Server ( array ( " command " => " user_information " , " user " => $ this -> user -> toArray ( ) ) ) ; $ server -> run ( ) ; $ response = $ server -> getResponse ( ) ; $ this -> assertNotNull ( $ response ) ; $ response = json_decode ( $ response , true ) ; $ this -> assertEquals ( " success " , $ response [ " result " ] ) ; $ this -> assertArrayHasKey ( " user " , $ response ) ; $ this -> assertArrayHasKey ( " editing " , $ response ) ; $ this -> assertArrayHasKey ( " editing_lock " , $ response ) ; }
Tests getting user information from the server
Tests getting user information from the server