Skip to content

Commit e84f6ea

Browse files
committed
expect more exception messages
1 parent d70bbf3 commit e84f6ea

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

tests/JoinSqlTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ public function testJoinDelete(): void
427427
$user = $user->getModel()->load(1);
428428

429429
$this->expectException(Exception::class);
430+
$this->expectExceptionMessage('Unable to delete due to query error');
430431
try {
431432
$user->delete();
432433
} catch (Exception $e) {

tests/Persistence/Sql/WithDb/SelectTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ public function testSelectUnexistingColumnException(): void
222222
$q = $this->q('employee')->field('Sqlite must use backticks for identifier escape');
223223

224224
$this->expectException(Exception::class);
225+
$this->expectExceptionMessage('Dsql execute error');
225226
$q->executeStatement();
226227
}
227228

@@ -308,6 +309,7 @@ public function testExecuteException(): void
308309
$q = $this->q('non_existing_table')->field('non_existing_field');
309310

310311
$this->expectException(ExecuteException::class);
312+
$this->expectExceptionMessage('Dsql execute error');
311313
try {
312314
$q->getOne();
313315
} catch (ExecuteException $e) {

tests/Schema/MigratorFkTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public function testCreateIndexUnique(): void
120120
], $client->export());
121121

122122
$this->expectException(Exception::class);
123+
$this->expectExceptionMessage('Unable to execute insert query');
123124
try {
124125
$client->insert(['name' => 'Michael']);
125126
} catch (Exception $e) {
@@ -190,6 +191,7 @@ public function testForeignKeyViolation(): void
190191
$client->insert(['name' => 'Ewa', 'created_by_client_id' => $clientId]);
191192

192193
$this->expectException(Exception::class);
194+
$this->expectExceptionMessage('Unable to execute insert query');
193195
try {
194196
$invoice->insert(['client_id' => 50]);
195197
} catch (Exception $e) {
@@ -263,6 +265,7 @@ public function testForeignKeyViolationWithoutPk(): void
263265
}
264266

265267
$this->expectException(Exception::class);
268+
$this->expectExceptionMessage('Unable to execute insert query');
266269
try {
267270
$price->insert(['amount' => 5, 'currency' => 'JPY']);
268271
} catch (Exception $e) {

0 commit comments

Comments
 (0)