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"?>
<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"
bootstrap="../../vendor/autoload.php"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
......@@ -24,11 +23,11 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
<groups>
<exclude>
......
<?xml version="1.0" encoding="utf-8"?>
<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"
bootstrap="../../vendor/autoload.php"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
......@@ -24,11 +23,11 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
<groups>
<exclude>
......
<?xml version="1.0" encoding="utf-8"?>
<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"
bootstrap="../../vendor/autoload.php"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
......@@ -24,11 +23,11 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
<groups>
<exclude>
......
<?xml version="1.0" encoding="utf-8"?>
<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"
bootstrap="../../vendor/autoload.php"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
......@@ -24,11 +23,11 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
<groups>
<exclude>
......
<?xml version="1.0" encoding="utf-8"?>
<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"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
......@@ -28,9 +28,9 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
</phpunit>
<?xml version="1.0" encoding="utf-8"?>
<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"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
......@@ -28,9 +28,9 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
</phpunit>
<?xml version="1.0" encoding="utf-8"?>
<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"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
......@@ -23,11 +23,11 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
<groups>
<exclude>
......
<?xml version="1.0" encoding="utf-8"?>
<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"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
......@@ -23,11 +23,11 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
<groups>
<exclude>
......
<?xml version="1.0" encoding="utf-8"?>
<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"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
......@@ -23,11 +23,11 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
<groups>
<exclude>
......
<?xml version="1.0" encoding="utf-8"?>
<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"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
......@@ -23,11 +23,11 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
<groups>
<exclude>
......
<?xml version="1.0" encoding="utf-8"?>
<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"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
......@@ -23,11 +23,11 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
<groups>
<exclude>
......
<?xml version="1.0" encoding="utf-8"?>
<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"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
......@@ -23,11 +23,11 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
<groups>
<exclude>
......
<?xml version="1.0" encoding="utf-8"?>
<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"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
......@@ -22,11 +22,11 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
<groups>
<exclude>
......
<?xml version="1.0" encoding="utf-8"?>
<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"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
......@@ -17,11 +17,11 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
<groups>
<exclude>
......
<?xml version="1.0" encoding="utf-8"?>
<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"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
......@@ -23,11 +23,11 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
</include>
</coverage>
<groups>
<exclude>
......
This diff is collapsed.
......@@ -12,7 +12,7 @@
Example: phpunit -c mysqlconf.xml
-->
<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"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
......@@ -48,9 +48,9 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</include>
</coverage>
</phpunit>
......@@ -52,7 +52,7 @@ final class LoggingTest extends TestCase
$logger->expects($this->once())
->method('startQuery')
->with($this->equalTo($expectedSQL), $this->equalTo([]));
$logger->expects($this->at(1))
$logger->expects($this->once())
->method('stopQuery');
$connection = new Connection([], $driver);
......
......@@ -127,7 +127,7 @@ class ConnectionTest extends TestCase
$eventManager->addEventListener([Events::postConnect], $listenerMock);
$driverMock = $this->createMock(Driver::class);
$driverMock->expects(self::at(0))
$driverMock->expects(self::once())
->method('connect');
$conn = new Connection([], $driverMock, new Configuration(), $eventManager);
......@@ -718,13 +718,11 @@ EOF
$originalException = new DBALException('Original exception');
$fallbackException = new DBALException('Fallback exception');
$driverMock->expects(self::at(0))
->method('connect')
->willThrowException($originalException);
$driverMock->expects(self::at(1))
->method('connect')
->willThrowException($fallbackException);
$driverMock->method('connect')
->will(self::onConsecutiveCalls(
self::throwException($originalException),
self::throwException($fallbackException)
));
$this->expectExceptionMessage($originalException->getMessage());
......
......@@ -1174,29 +1174,17 @@ class ComparatorTest extends TestCase
->method('getNamespaces')
->will(self::returnValue(['foo', 'bar']));
$fromSchema->expects(self::at(0))
->method('hasNamespace')
->with('bar')
->will(self::returnValue(true));
$fromSchema->expects(self::at(1))
->method('hasNamespace')
->with('baz')
->will(self::returnValue(false));
$fromSchema->method('hasNamespace')
->withConsecutive(['bar'], ['baz'])
->willReturnOnConsecutiveCalls(true, false);
$toSchema->expects(self::once())
->method('getNamespaces')
->will(self::returnValue(['bar', 'baz']));
$toSchema->expects(self::at(1))
->method('hasNamespace')
->with('foo')
->will(self::returnValue(false));
$toSchema->expects(self::at(2))
->method('hasNamespace')
->with('bar')
->will(self::returnValue(true));
$toSchema->method('hasNamespace')
->withConsecutive(['foo'], ['bar'])
->willReturnOnConsecutiveCalls(false, true);
$expected = new SchemaDiff();
$expected->fromSchema = $fromSchema;
......
......@@ -371,7 +371,7 @@ class SchemaTest extends TestCase
[$schema->getSequence('war')]
);
self::assertNull($schema->visit($visitor));
$schema->visit($visitor);
}
public function testVisitsNamespaceVisitor(): void
......@@ -392,34 +392,24 @@ class SchemaTest extends TestCase
->method('acceptSchema')
->with($schema);
$visitor->expects(self::at(1))
$visitor->expects($this->exactly(3))
->method('acceptNamespace')
->with('foo');
->withConsecutive(['foo'], ['bar'], ['bla']);
$visitor->expects(self::at(2))
->method('acceptNamespace')
->with('bar');
$visitor->expects(self::at(3))
->method('acceptNamespace')
->with('bla');
$visitor->expects($this->at(4))
$visitor->expects($this->exactly(2))
->method('acceptTable')
->with($schema->getTable('baz'));
$visitor->expects(self::at(5))
->method('acceptTable')
->with($schema->getTable('bla.bloo'));
$visitor->expects($this->at(6))
->method('acceptSequence')
->with($schema->getSequence('moo'));
->withConsecutive(
[$schema->getTable('baz')],
[$schema->getTable('bla.bloo')]
);
$visitor->expects(self::at(7))
$visitor->expects($this->exactly(2))
->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
->willReturn(['foo']);
}
public function testAcceptsNamespace(): void
public function testAcceptsNamespaceDoesNotSupportSchemas(): void
{
$this->platformMock->expects(self::at(0))
->method('supportsSchemas')
->will(self::returnValue(false));
$this->platformMock->expects(self::at(1))
->method('supportsSchemas')
->will(self::returnValue(true));
$this->platformMock->method('supportsSchemas')
->willReturn(false);
$this->visitor->acceptNamespace('foo');
self::assertEmpty($this->visitor->getQueries());
}
public function testAcceptsNamespaceSupportsSchemas(): void
{
$this->platformMock->method('supportsSchemas')
->willReturn(true);
$this->visitor->acceptNamespace('foo');
......@@ -73,15 +74,10 @@ class CreateSchemaSqlCollectorTest extends TestCase
self::assertSame(['foo'], $this->visitor->getQueries());
}
public function testAcceptsForeignKey(): void
public function testAcceptsForeignKeyDoesNotSupportCreateDropForeignKeyConstraints(): void
{
$this->platformMock->expects(self::at(0))
->method('supportsCreateDropForeignKeyConstraints')
->will(self::returnValue(false));
$this->platformMock->expects(self::at(1))
->method('supportsCreateDropForeignKeyConstraints')
->will(self::returnValue(true));
$this->platformMock->method('supportsCreateDropForeignKeyConstraints')
->willReturn(false);
$table = $this->createTableMock();
$foreignKey = $this->createForeignKeyConstraintMock();
......@@ -89,6 +85,15 @@ class CreateSchemaSqlCollectorTest extends TestCase
$this->visitor->acceptForeignKey($table, $foreignKey);
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);
......
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