ActiveRecordTest::testError PHP Method

testError() public method

public testError ( )
    public function testError()
    {
        try {
            ActiveRecord::$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
            ActiveRecord::execute('CREATE TABLE IF NOT EXISTS');
        } catch (Exception $e) {
            $this->assertInstanceOf('PDOException', $e);
            $this->assertEquals('HY000', $e->getCode());
            $this->assertEquals('SQLSTATE[HY000]: General error: 1 near "EXISTS": syntax error', $e->getMessage());
        }
    }