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:
fi
install:
- |
if [[ $TRAVIS_PHP_VERSION = "nightly" ]]; then
export COMPOSER_FLAGS="--ignore-platform-reqs"
fi
- travis_retry composer -n install --prefer-dist $COMPOSER_FLAGS
- travis_retry composer -n install --prefer-dist
script:
- ./vendor/bin/phpunit --configuration ci/travis/$DB.travis.xml --coverage-clover clover.xml
......
<?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>
......@@ -54,7 +54,7 @@ final class LoggingTest extends TestCase
$logger->expects(self::once())
->method('startQuery')
->with(self::equalTo($expectedSQL), self::equalTo([]));
$logger->expects(self::at(1))
$logger->expects(self::once())
->method('stopQuery');
$connection = new Connection([], $driver);
......
......@@ -117,7 +117,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);
......@@ -684,13 +684,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());
......
......@@ -1177,29 +1177,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;
......
......@@ -393,36 +393,24 @@ class SchemaTest extends TestCase
->method('acceptSchema')
->with($schema);
$visitor->expects(self::at(1))
$visitor->expects(self::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(self::at(4))
->method('acceptTable')
->with($schema->getTable('baz'));
$visitor->expects(self::at(5))
$visitor->expects(self::exactly(2))
->method('acceptTable')
->with($schema->getTable('bla.bloo'));
$visitor->expects(self::at(6))
->method('acceptSequence')
->with($schema->getSequence('moo'));
->withConsecutive(
[$schema->getTable('baz')],
[$schema->getTable('bla.bloo')]
);
$visitor->expects(self::at(7))
$visitor->expects(self::exactly(2))
->method('acceptSequence')
->with($schema->getSequence('war'));
->withConsecutive(
[$schema->getSequence('moo')],
[$schema->getSequence('war')]
);
$schema->visit($visitor);
self::doesNotPerformAssertions(); // FIXME
}
}
......@@ -47,19 +47,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');
......@@ -75,15 +76,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();
......@@ -91,6 +87,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