test/snac/server/database/DatabaseConnectorTest.php
/**
     * Test an execute without a prepare
     */
Test an execute without a prepare
Test an execute without a prepare
public function testDatabaseExecuteNoPrepare() {
        try {
            $db = new \snac\server\database\DatabaseConnector();
            $db->execute("testStatement2", array());
            $this->fail("Allowed execute with no prepare.");
        } catch (\snac\exceptions\SNACDatabaseException $e) {
            $message = $e->getMessage();
            $this->assertEquals("pg_execute(): Query failed: ERROR:  prepared statement \"testStatement2\" does not exist", substr($message, 0));
        }
    }
public function testDatabaseExecuteNoPrepare ( ) { try { $ db = new \ snac \ server \ database \ DatabaseConnector ( ) ; $ db -> execute ( " testStatement2 " , array ( ) ) ; $ this -> fail ( " Allowed execute with no prepare. " ) ; } catch ( \ snac \ exceptions \ SNACDatabaseException $ e ) { $ message = $ e -> getMessage ( ) ; $ this -> assertEquals ( " pg_execute(): Query failed: ERROR:  prepared statement  \" testStatement2 \"  does not exist " , substr ( $ message , 0 ) ) ; } }
Test an execute without a prepare
Test an execute without a prepare