Skip to content

Commit

Permalink
Add assertions to resolve uncovered operations flagged by infection tool
Browse files Browse the repository at this point in the history
  • Loading branch information
kdebisschop committed Jan 10, 2021
1 parent 37d1fe1 commit 9e6dc09
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/Database/StatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,13 @@ public function prepareInvalid(): void
$statement = new Statement($database);
$statement->select('foo', ['>']);

static::expectException(\PDOException::class);
$statement->prepare();
try {
$statement->prepare();
static::fail('An exception should have been thrown');
} catch (\PDOException $exception) {
static::assertEquals('SQLSTATE[HY000]: General error: 1 near ">": syntax error', $exception->getMessage());
} catch (\Exception $exception) {
static::fail('An instance of ' . \PDOException::class . ' should have been thrown');
}
}
}

0 comments on commit 9e6dc09

Please sign in to comment.