Skip to content

Commit

Permalink
MNT Skip test in MySQL8
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jul 21, 2022
1 parent 674e6d9 commit e20bbd7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/php/ORM/DataObjectSchemaGenerationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use SilverStripe\ORM\FieldType\DBEnum;
use SilverStripe\ORM\DataObject;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\ORM\Connect\MySQLiConnector;
use SilverStripe\ORM\Tests\DataObjectSchemaGenerationTest\SortedObject;
use SilverStripe\ORM\Tests\DataObjectSchemaGenerationTest\TestIndexObject;
use SilverStripe\ORM\Tests\DataObjectSchemaGenerationTest\TestObject;
Expand Down Expand Up @@ -67,11 +68,26 @@ function () {
);
}

private function isMySQL8(): bool
{
$connector = DB::get_conn()->getConnector();
if ($connector instanceof MySQLiConnector &&
preg_match('#^8\.#', $connector->getVersion())
) {
return true;
}
return false;
}

/**
* Check that once a schema has been generated, then it doesn't need any more updating
*/
public function testFieldsDontRerequestChanges()
{
// TODO: remove the MySQL8 skip when `int(11)` is no longer the default field type for integers and has been replaced with `int`
if ($this->isMySQL8()) {
$this->markTestSkipped();
}
$schema = DB::get_schema();
$test = $this;
DB::quiet();
Expand Down Expand Up @@ -126,6 +142,10 @@ function () use ($test, $schema) {
*/
public function testIndexesDontRerequestChanges()
{
// TODO: remove the MySQL8 skip when `int(11)` is no longer the default field type for integers and has been replaced with `int`
if ($this->isMySQL8()) {
$this->markTestSkipped();
}
$schema = DB::get_schema();
$test = $this;
DB::quiet();
Expand Down

0 comments on commit e20bbd7

Please sign in to comment.