Skip to content

Commit ed1e816

Browse files
committed
1 parent 5e98d65 commit ed1e816

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/Database/Connection.getInsertId().postgre.phpt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ $connection->query('
2121
');
2222

2323
$connection->query('INSERT INTO primarykey (prim) VALUES (5)');
24-
Assert::equal('0', $connection->getInsertId());
25-
26-
$connection->query('INSERT INTO primarykey (prim) VALUES (6)');
27-
Assert::equal('0', $connection->getInsertId());
24+
if (PHP_VERSION_ID >= 70016) {
25+
Assert::exception(function () use ($connection) {
26+
$connection->getInsertId();
27+
}, Nette\Database\DriverException::class);
28+
} else {
29+
Assert::equal('0', $connection->getInsertId());
30+
}
2831

2932

3033
$connection->query('

0 commit comments

Comments
 (0)