1
0
mirror of https://github.com/danog/ext-pq.git synced 2024-11-26 11:54:50 +01:00
ext-pq/tests/exceptions002.phpt
Michael Wallner 3024b0b5a9 tests & fixes
2013-02-14 14:54:22 +01:00

27 lines
445 B
PHP

--TEST--
sql exception
--SKIPIF--
<?php include "_skipif.inc"; ?>
--FILE--
<?php
echo "Test\n";
include "_setup.inc";
$c = new pq\Connection(PQ_DSN);
try {
$r = $c->exec("SELECT 1 FROM probably_non_existent_table");
} catch (pq\Exception $e) {
var_dump($e instanceof pq\Exception\DomainException);
var_dump($e->getCode() == pq\Exception::SQL);
var_dump($e->sqlstate);
}
?>
DONE
--EXPECT--
Test
bool(true)
bool(true)
string(5) "42P01"
DONE