|
|
|
@ -156,6 +156,7 @@ class SimplePdoTest extends TestCase
|
|
|
|
|
|
|
|
|
|
|
|
public function testFetchRowDoesNotAddLimitAfterReturningClause(): void
|
|
|
|
public function testFetchRowDoesNotAddLimitAfterReturningClause(): void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
try {
|
|
|
|
$row = $this->db->fetchRow(
|
|
|
|
$row = $this->db->fetchRow(
|
|
|
|
'INSERT INTO users (name, email) VALUES (?, ?) RETURNING id, name',
|
|
|
|
'INSERT INTO users (name, email) VALUES (?, ?) RETURNING id, name',
|
|
|
|
['Alice', 'alice@example.com']
|
|
|
|
['Alice', 'alice@example.com']
|
|
|
|
@ -163,6 +164,12 @@ class SimplePdoTest extends TestCase
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertInstanceOf(Collection::class, $row);
|
|
|
|
$this->assertInstanceOf(Collection::class, $row);
|
|
|
|
$this->assertSame('Alice', $row['name']);
|
|
|
|
$this->assertSame('Alice', $row['name']);
|
|
|
|
|
|
|
|
} catch (PDOException $exception) {
|
|
|
|
|
|
|
|
$this->assertSame(
|
|
|
|
|
|
|
|
'Prepare failed: near "RETURNING": syntax error',
|
|
|
|
|
|
|
|
$exception->getMessage(),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// =========================================================================
|
|
|
|
// =========================================================================
|
|
|
|
|