Unverified Commit 74419019 authored by Sergei Morozov's avatar Sergei Morozov

Merge branch '3.0.x' into master

parents 859e80c9 aa848d82
...@@ -18,11 +18,7 @@ before_script: ...@@ -18,11 +18,7 @@ before_script:
fi fi
install: install:
- | - travis_retry composer -n install --prefer-dist
if [[ $TRAVIS_PHP_VERSION = "nightly" ]]; then
export COMPOSER_FLAGS="--ignore-platform-reqs"
fi
- travis_retry composer -n install --prefer-dist $COMPOSER_FLAGS
script: script:
- ./vendor/bin/phpunit --configuration ci/travis/$DB.travis.xml --coverage-clover clover.xml - ./vendor/bin/phpunit --configuration ci/travis/$DB.travis.xml --coverage-clover clover.xml
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
bootstrap="../../vendor/autoload.php"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true" failOnRisky="true"
...@@ -24,11 +23,11 @@ ...@@ -24,11 +23,11 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
<groups> <groups>
<exclude> <exclude>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
bootstrap="../../vendor/autoload.php"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true" failOnRisky="true"
...@@ -24,11 +23,11 @@ ...@@ -24,11 +23,11 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
<groups> <groups>
<exclude> <exclude>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
bootstrap="../../vendor/autoload.php"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true" failOnRisky="true"
...@@ -24,11 +23,11 @@ ...@@ -24,11 +23,11 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
<groups> <groups>
<exclude> <exclude>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
bootstrap="../../vendor/autoload.php"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true" failOnRisky="true"
...@@ -24,11 +23,11 @@ ...@@ -24,11 +23,11 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
<groups> <groups>
<exclude> <exclude>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
</phpunit> </phpunit>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
</phpunit> </phpunit>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
<groups> <groups>
<exclude> <exclude>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
<groups> <groups>
<exclude> <exclude>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
<groups> <groups>
<exclude> <exclude>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
<groups> <groups>
<exclude> <exclude>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
<groups> <groups>
<exclude> <exclude>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
<groups> <groups>
<exclude> <exclude>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
<groups> <groups>
<exclude> <exclude>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
<groups> <groups>
<exclude> <exclude>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">../../src</directory> <directory suffix=".php">../../src</directory>
</whitelist> </include>
</filter> </coverage>
<groups> <groups>
<exclude> <exclude>
......
This diff is collapsed.
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
Example: phpunit -c mysqlconf.xml Example: phpunit -c mysqlconf.xml
--> -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/schema/9.3.xsd"
colors="true" colors="true"
beStrictAboutOutputDuringTests="true" beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true" beStrictAboutTodoAnnotatedTests="true"
...@@ -48,9 +48,9 @@ ...@@ -48,9 +48,9 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter> <coverage>
<whitelist> <include>
<directory suffix=".php">src</directory> <directory suffix=".php">src</directory>
</whitelist> </include>
</filter> </coverage>
</phpunit> </phpunit>
...@@ -54,7 +54,7 @@ final class LoggingTest extends TestCase ...@@ -54,7 +54,7 @@ final class LoggingTest extends TestCase
$logger->expects(self::once()) $logger->expects(self::once())
->method('startQuery') ->method('startQuery')
->with(self::equalTo($expectedSQL), self::equalTo([])); ->with(self::equalTo($expectedSQL), self::equalTo([]));
$logger->expects(self::at(1)) $logger->expects(self::once())
->method('stopQuery'); ->method('stopQuery');
$connection = new Connection([], $driver); $connection = new Connection([], $driver);
......
...@@ -117,7 +117,7 @@ class ConnectionTest extends TestCase ...@@ -117,7 +117,7 @@ class ConnectionTest extends TestCase
$eventManager->addEventListener([Events::postConnect], $listenerMock); $eventManager->addEventListener([Events::postConnect], $listenerMock);
$driverMock = $this->createMock(Driver::class); $driverMock = $this->createMock(Driver::class);
$driverMock->expects(self::at(0)) $driverMock->expects(self::once())
->method('connect'); ->method('connect');
$conn = new Connection([], $driverMock, new Configuration(), $eventManager); $conn = new Connection([], $driverMock, new Configuration(), $eventManager);
...@@ -684,13 +684,11 @@ EOF ...@@ -684,13 +684,11 @@ EOF
$originalException = new DBALException('Original exception'); $originalException = new DBALException('Original exception');
$fallbackException = new DBALException('Fallback exception'); $fallbackException = new DBALException('Fallback exception');
$driverMock->expects(self::at(0)) $driverMock->method('connect')
->method('connect') ->will(self::onConsecutiveCalls(
->willThrowException($originalException); self::throwException($originalException),
self::throwException($fallbackException)
$driverMock->expects(self::at(1)) ));
->method('connect')
->willThrowException($fallbackException);
$this->expectExceptionMessage($originalException->getMessage()); $this->expectExceptionMessage($originalException->getMessage());
......
...@@ -1177,29 +1177,17 @@ class ComparatorTest extends TestCase ...@@ -1177,29 +1177,17 @@ class ComparatorTest extends TestCase
->method('getNamespaces') ->method('getNamespaces')
->will(self::returnValue(['foo', 'bar'])); ->will(self::returnValue(['foo', 'bar']));
$fromSchema->expects(self::at(0)) $fromSchema->method('hasNamespace')
->method('hasNamespace') ->withConsecutive(['bar'], ['baz'])
->with('bar') ->willReturnOnConsecutiveCalls(true, false);
->will(self::returnValue(true));
$fromSchema->expects(self::at(1))
->method('hasNamespace')
->with('baz')
->will(self::returnValue(false));
$toSchema->expects(self::once()) $toSchema->expects(self::once())
->method('getNamespaces') ->method('getNamespaces')
->will(self::returnValue(['bar', 'baz'])); ->will(self::returnValue(['bar', 'baz']));
$toSchema->expects(self::at(1)) $toSchema->method('hasNamespace')
->method('hasNamespace') ->withConsecutive(['foo'], ['bar'])
->with('foo') ->willReturnOnConsecutiveCalls(false, true);
->will(self::returnValue(false));
$toSchema->expects(self::at(2))
->method('hasNamespace')
->with('bar')
->will(self::returnValue(true));
$expected = new SchemaDiff(); $expected = new SchemaDiff();
$expected->fromSchema = $fromSchema; $expected->fromSchema = $fromSchema;
......
...@@ -393,36 +393,24 @@ class SchemaTest extends TestCase ...@@ -393,36 +393,24 @@ class SchemaTest extends TestCase
->method('acceptSchema') ->method('acceptSchema')
->with($schema); ->with($schema);
$visitor->expects(self::at(1)) $visitor->expects(self::exactly(3))
->method('acceptNamespace') ->method('acceptNamespace')
->with('foo'); ->withConsecutive(['foo'], ['bar'], ['bla']);
$visitor->expects(self::at(2)) $visitor->expects(self::exactly(2))
->method('acceptNamespace')
->with('bar');
$visitor->expects(self::at(3))
->method('acceptNamespace')
->with('bla');
$visitor->expects(self::at(4))
->method('acceptTable')
->with($schema->getTable('baz'));
$visitor->expects(self::at(5))
->method('acceptTable') ->method('acceptTable')
->with($schema->getTable('bla.bloo')); ->withConsecutive(
[$schema->getTable('baz')],
$visitor->expects(self::at(6)) [$schema->getTable('bla.bloo')]
->method('acceptSequence') );
->with($schema->getSequence('moo'));
$visitor->expects(self::at(7)) $visitor->expects(self::exactly(2))
->method('acceptSequence') ->method('acceptSequence')
->with($schema->getSequence('war')); ->withConsecutive(
[$schema->getSequence('moo')],
[$schema->getSequence('war')]
);
$schema->visit($visitor); $schema->visit($visitor);
self::doesNotPerformAssertions(); // FIXME
} }
} }
...@@ -47,19 +47,20 @@ class CreateSchemaSqlCollectorTest extends TestCase ...@@ -47,19 +47,20 @@ class CreateSchemaSqlCollectorTest extends TestCase
->willReturn(['foo']); ->willReturn(['foo']);
} }
public function testAcceptsNamespace(): void public function testAcceptsNamespaceDoesNotSupportSchemas(): void
{ {
$this->platformMock->expects(self::at(0)) $this->platformMock->method('supportsSchemas')
->method('supportsSchemas') ->willReturn(false);
->will(self::returnValue(false));
$this->platformMock->expects(self::at(1))
->method('supportsSchemas')
->will(self::returnValue(true));
$this->visitor->acceptNamespace('foo'); $this->visitor->acceptNamespace('foo');
self::assertEmpty($this->visitor->getQueries()); self::assertEmpty($this->visitor->getQueries());
}
public function testAcceptsNamespaceSupportsSchemas(): void
{
$this->platformMock->method('supportsSchemas')
->willReturn(true);
$this->visitor->acceptNamespace('foo'); $this->visitor->acceptNamespace('foo');
...@@ -75,15 +76,10 @@ class CreateSchemaSqlCollectorTest extends TestCase ...@@ -75,15 +76,10 @@ class CreateSchemaSqlCollectorTest extends TestCase
self::assertSame(['foo'], $this->visitor->getQueries()); self::assertSame(['foo'], $this->visitor->getQueries());
} }
public function testAcceptsForeignKey(): void public function testAcceptsForeignKeyDoesNotSupportCreateDropForeignKeyConstraints(): void
{ {
$this->platformMock->expects(self::at(0)) $this->platformMock->method('supportsCreateDropForeignKeyConstraints')
->method('supportsCreateDropForeignKeyConstraints') ->willReturn(false);
->will(self::returnValue(false));
$this->platformMock->expects(self::at(1))
->method('supportsCreateDropForeignKeyConstraints')
->will(self::returnValue(true));
$table = $this->createTableMock(); $table = $this->createTableMock();
$foreignKey = $this->createForeignKeyConstraintMock(); $foreignKey = $this->createForeignKeyConstraintMock();
...@@ -91,6 +87,15 @@ class CreateSchemaSqlCollectorTest extends TestCase ...@@ -91,6 +87,15 @@ class CreateSchemaSqlCollectorTest extends TestCase
$this->visitor->acceptForeignKey($table, $foreignKey); $this->visitor->acceptForeignKey($table, $foreignKey);
self::assertEmpty($this->visitor->getQueries()); self::assertEmpty($this->visitor->getQueries());
}
public function testAcceptsForeignKeySupportsCreateDropForeignKeyConstraints(): void
{
$this->platformMock->method('supportsCreateDropForeignKeyConstraints')
->willReturn(true);
$table = $this->createTableMock();
$foreignKey = $this->createForeignKeyConstraintMock();
$this->visitor->acceptForeignKey($table, $foreignKey); $this->visitor->acceptForeignKey($table, $foreignKey);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment