test/snac/server/ServerTest.php
/**
     * Tests that the server can start a session
     */
Tests that the server can start a session
Tests that the server can start a session
public function testStartSession() {
        $server = new Server( array(
                "command" => "start_session"
        ));
        $server->run();
        $response = $server->getResponse();
        $this->assertNotNull($response);
        $response = json_decode($response, true);
        $this->assertEquals("failure", $response["result"]);
        $server = new Server( array(
                "command" => "start_session",
                "user" => $this->user->toArray()
        ));
        $server->run();
        $response = $server->getResponse();
        $this->assertNotNull($response);
        $response = json_decode($response, true);
        $this->assertEquals("success", $response["result"]);
    }
public function testStartSession ( ) { $ server = new Server ( array ( " command " => " start_session " ) ) ; $ server -> run ( ) ; $ response = $ server -> getResponse ( ) ; $ this -> assertNotNull ( $ response ) ; $ response = json_decode ( $ response , true ) ; $ this -> assertEquals ( " failure " , $ response [ " result " ] ) ; $ server = new Server ( array ( " command " => " start_session " , " user " => $ this -> user -> toArray ( ) ) ) ; $ server -> run ( ) ; $ response = $ server -> getResponse ( ) ; $ this -> assertNotNull ( $ response ) ; $ response = json_decode ( $ response , true ) ; $ this -> assertEquals ( " success " , $ response [ " result " ] ) ; }
Tests that the server can start a session
Tests that the server can start a session