test/snac/server/ServerTest.php
/**
     * Tests to ensure that the server outputs JSON when given garbage input
     */
Tests to ensure that the server outputs JSON when given garbage input
Tests to ensure that the server outputs JSON when given garbage input
public function testJSONOutGarbage() {
        try {
            $server = new Server(5);
            $server->run();
            $this->assertNotNull(json_decode($server->getResponse()));
        } catch (\snac\exceptions\SNACUnknownCommandException $e) {
        }
        try {
            $server = new Server("testing");
            $server->run();
            $this->assertNotNull(json_decode($server->getResponse()));
        } catch (\snac\exceptions\SNACUnknownCommandException $e) {
        }
    }
public function testJSONOutGarbage ( ) { try { $ server = new Server ( 5 ) ; $ server -> run ( ) ; $ this -> assertNotNull ( json_decode ( $ server -> getResponse ( ) ) ) ; } catch ( \ snac \ exceptions \ SNACUnknownCommandException $ e ) { } try { $ server = new Server ( " testing " ) ; $ server -> run ( ) ; $ this -> assertNotNull ( json_decode ( $ server -> getResponse ( ) ) ) ; } catch ( \ snac \ exceptions \ SNACUnknownCommandException $ e ) { } }
Tests to ensure that the server outputs JSON when given garbage input
Tests to ensure that the server outputs JSON when given garbage input
// this is good // this is good