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

Merge branch '2.11.x' into 3.0.x

parents 95b40a13 dba0ea26
<?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>
...@@ -52,7 +52,7 @@ final class LoggingTest extends TestCase ...@@ -52,7 +52,7 @@ final class LoggingTest extends TestCase
$logger->expects($this->once()) $logger->expects($this->once())
->method('startQuery') ->method('startQuery')
->with($this->equalTo($expectedSQL), $this->equalTo([])); ->with($this->equalTo($expectedSQL), $this->equalTo([]));
$logger->expects($this->at(1)) $logger->expects($this->once())
->method('stopQuery'); ->method('stopQuery');
$connection = new Connection([], $driver); $connection = new Connection([], $driver);
......
...@@ -127,7 +127,7 @@ class ConnectionTest extends TestCase ...@@ -127,7 +127,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);
...@@ -718,13 +718,11 @@ EOF ...@@ -718,13 +718,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());
......
...@@ -1174,29 +1174,17 @@ class ComparatorTest extends TestCase ...@@ -1174,29 +1174,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;
......
...@@ -371,7 +371,7 @@ class SchemaTest extends TestCase ...@@ -371,7 +371,7 @@ class SchemaTest extends TestCase
[$schema->getSequence('war')] [$schema->getSequence('war')]
); );
self::assertNull($schema->visit($visitor)); $schema->visit($visitor);
} }
public function testVisitsNamespaceVisitor(): void public function testVisitsNamespaceVisitor(): void
...@@ -392,34 +392,24 @@ class SchemaTest extends TestCase ...@@ -392,34 +392,24 @@ class SchemaTest extends TestCase
->method('acceptSchema') ->method('acceptSchema')
->with($schema); ->with($schema);
$visitor->expects(self::at(1)) $visitor->expects($this->exactly(3))
->method('acceptNamespace') ->method('acceptNamespace')
->with('foo'); ->withConsecutive(['foo'], ['bar'], ['bla']);
$visitor->expects(self::at(2)) $visitor->expects($this->exactly(2))
->method('acceptNamespace')
->with('bar');
$visitor->expects(self::at(3))
->method('acceptNamespace')
->with('bla');
$visitor->expects($this->at(4))
->method('acceptTable') ->method('acceptTable')
->with($schema->getTable('baz')); ->withConsecutive(
[$schema->getTable('baz')],
$visitor->expects(self::at(5)) [$schema->getTable('bla.bloo')]
->method('acceptTable') );
->with($schema->getTable('bla.bloo'));
$visitor->expects($this->at(6))
->method('acceptSequence')
->with($schema->getSequence('moo'));
$visitor->expects(self::at(7)) $visitor->expects($this->exactly(2))
->method('acceptSequence') ->method('acceptSequence')
->with($schema->getSequence('war')); ->withConsecutive(
[$schema->getSequence('moo')],
[$schema->getSequence('war')]
);
self::assertNull($schema->visit($visitor)); $schema->visit($visitor);
} }
} }
...@@ -45,19 +45,20 @@ class CreateSchemaSqlCollectorTest extends TestCase ...@@ -45,19 +45,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');
...@@ -73,15 +74,10 @@ class CreateSchemaSqlCollectorTest extends TestCase ...@@ -73,15 +74,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();
...@@ -89,6 +85,15 @@ class CreateSchemaSqlCollectorTest extends TestCase ...@@ -89,6 +85,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