Skip to content

Commit

Permalink
Merge pull request #10868 from creative-commoners/pulls/5.0/unit-test
Browse files Browse the repository at this point in the history
MNT Fix unit test
  • Loading branch information
GuySartorelli authored Jul 11, 2023
2 parents b88e7fe + 3aa6d59 commit 9b2aee1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/php/ORM/DataListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use SilverStripe\ORM\Tests\DataObjectTest\TeamComment;
use SilverStripe\ORM\Tests\DataObjectTest\ValidatedObject;
use SilverStripe\ORM\Tests\ManyManyListTest\Category;
use SilverStripe\ORM\Connect\DatabaseException;

class DataListTest extends SapphireTest
{
Expand Down Expand Up @@ -1860,7 +1861,7 @@ public function testRawSqlSort(string $sort, string $type): void
if (!(DB::get_conn()->getConnector() instanceof MySQLiConnector)) {
$this->markTestSkipped('Database connector is not MySQLiConnector');
}
$this->expectException(\mysqli_sql_exception::class);
$this->expectException(DatabaseException::class);
$this->expectExceptionMessageMatches('/Unknown column/');
} elseif ($type === 'invalid-column') {
$this->expectException(InvalidArgumentException::class);
Expand Down Expand Up @@ -1891,7 +1892,7 @@ public function testRawSqlOrderBy(string $sort, string $type): void
if (!(DB::get_conn()->getConnector() instanceof MySQLiConnector)) {
$this->markTestSkipped('Database connector is not MySQLiConnector');
}
$this->expectException(\mysqli_sql_exception::class);
$this->expectException(DatabaseException::class);
if ($type === 'error-in-sql-syntax') {
$this->expectExceptionMessageMatches('/You have an error in your SQL syntax/');
} else {
Expand Down

0 comments on commit 9b2aee1

Please sign in to comment.