mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #10868 from creative-commoners/pulls/5.0/unit-test
MNT Fix unit test
This commit is contained in:
commit
9b2aee10dc
@ -26,6 +26,7 @@ use SilverStripe\ORM\Tests\DataObjectTest\Team;
|
|||||||
use SilverStripe\ORM\Tests\DataObjectTest\TeamComment;
|
use SilverStripe\ORM\Tests\DataObjectTest\TeamComment;
|
||||||
use SilverStripe\ORM\Tests\DataObjectTest\ValidatedObject;
|
use SilverStripe\ORM\Tests\DataObjectTest\ValidatedObject;
|
||||||
use SilverStripe\ORM\Tests\ManyManyListTest\Category;
|
use SilverStripe\ORM\Tests\ManyManyListTest\Category;
|
||||||
|
use SilverStripe\ORM\Connect\DatabaseException;
|
||||||
|
|
||||||
class DataListTest extends SapphireTest
|
class DataListTest extends SapphireTest
|
||||||
{
|
{
|
||||||
@ -1860,7 +1861,7 @@ class DataListTest extends SapphireTest
|
|||||||
if (!(DB::get_conn()->getConnector() instanceof MySQLiConnector)) {
|
if (!(DB::get_conn()->getConnector() instanceof MySQLiConnector)) {
|
||||||
$this->markTestSkipped('Database connector is not MySQLiConnector');
|
$this->markTestSkipped('Database connector is not MySQLiConnector');
|
||||||
}
|
}
|
||||||
$this->expectException(\mysqli_sql_exception::class);
|
$this->expectException(DatabaseException::class);
|
||||||
$this->expectExceptionMessageMatches('/Unknown column/');
|
$this->expectExceptionMessageMatches('/Unknown column/');
|
||||||
} elseif ($type === 'invalid-column') {
|
} elseif ($type === 'invalid-column') {
|
||||||
$this->expectException(InvalidArgumentException::class);
|
$this->expectException(InvalidArgumentException::class);
|
||||||
@ -1891,7 +1892,7 @@ class DataListTest extends SapphireTest
|
|||||||
if (!(DB::get_conn()->getConnector() instanceof MySQLiConnector)) {
|
if (!(DB::get_conn()->getConnector() instanceof MySQLiConnector)) {
|
||||||
$this->markTestSkipped('Database connector is not MySQLiConnector');
|
$this->markTestSkipped('Database connector is not MySQLiConnector');
|
||||||
}
|
}
|
||||||
$this->expectException(\mysqli_sql_exception::class);
|
$this->expectException(DatabaseException::class);
|
||||||
if ($type === 'error-in-sql-syntax') {
|
if ($type === 'error-in-sql-syntax') {
|
||||||
$this->expectExceptionMessageMatches('/You have an error in your SQL syntax/');
|
$this->expectExceptionMessageMatches('/You have an error in your SQL syntax/');
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user