public function testStatementRewind(): void
{ $statement =
$this->connection->
query('SELECT * FROM {test}'
);
foreach ($statement as $row) { $this->
assertNotNull($row);
} // Trying to iterate through the same statement again should fail.
$this->
expectError();
$this->
expectErrorMessage('Attempted rewinding a StatementInterface object when fetching has already started. Refactor your code to avoid rewinding statement objects.'
);
foreach ($statement as $row) { $this->
assertNotNull($row);
} } /**
* Tests empty statement rewinding.
*/
public function testEmptyStatementRewind(): void
{ $statement =
$this->connection->
query('SELECT * FROM {test} WHERE 1 = 0'
);