Skip to content

Commit 4db2580

Browse files
committed
Improve test
1 parent 5dfe701 commit 4db2580

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ext/pgsql/tests/pg_fetch_object_with_abstract_class.phpt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,23 @@ pg_query($db, "CREATE TABLE {$table_name} (a integer, b text)");
2424
pg_query($db, "INSERT INTO {$table_name} VALUES(0, 'ABC')");
2525

2626
$sql = "SELECT * FROM $table_name WHERE a = 0";
27-
$result = pg_query($db, $sql) or die('Cannot query db');
28-
var_dump(pg_num_rows($result));
2927

3028
try {
29+
$result = pg_query($db, $sql);
3130
var_dump(pg_fetch_object($result, NULL, 'I'));
3231
} catch(Throwable $e) {
3332
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
3433
}
3534

3635
try {
36+
$result = pg_query($db, $sql);
3737
var_dump(pg_fetch_object($result, NULL, 'C'));
3838
} catch(Throwable $e) {
3939
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
4040
}
4141

4242
try {
43+
$result = pg_query($db, $sql);
4344
var_dump(pg_fetch_object($result, NULL, 'E'));
4445
} catch(Throwable $e) {
4546
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
@@ -52,4 +53,6 @@ $db = pg_connect($conn_str);
5253
pg_query($db, "DROP TABLE IF EXISTS pg_fetch_object_abstract_class cascade");
5354
?>
5455
--EXPECT--
55-
int(1)
56+
Error: Cannot instantiate interface I
57+
Error: Cannot instantiate abstract class C
58+
Error: Cannot instantiate enum E

0 commit comments

Comments
 (0)