Fixed dynamic calls to static methods

parent 4edcd154
This diff is collapsed.
......@@ -76,7 +76,7 @@ abstract class AbstractDriverTest extends TestCase
public function testConvertsException($errorCode, ?string $sqlState, ?string $message, string $expectedClass) : void
{
if (! $this->driver instanceof ExceptionConverterDriver) {
$this->markTestSkipped('This test is only intended for exception converter drivers.');
self::markTestSkipped('This test is only intended for exception converter drivers.');
}
/** @var DriverExceptionInterface|MockObject $driverException */
......@@ -102,7 +102,7 @@ abstract class AbstractDriverTest extends TestCase
public function testCreatesDatabasePlatformForVersion() : void
{
if (! $this->driver instanceof VersionAwarePlatformDriver) {
$this->markTestSkipped('This test is only intended for version aware platform drivers.');
self::markTestSkipped('This test is only intended for version aware platform drivers.');
}
$data = $this->getDatabasePlatformsForVersions();
......@@ -135,7 +135,7 @@ abstract class AbstractDriverTest extends TestCase
public function testThrowsExceptionOnCreatingDatabasePlatformsForInvalidVersion() : void
{
if (! $this->driver instanceof VersionAwarePlatformDriver) {
$this->markTestSkipped('This test is only intended for version aware platform drivers.');
self::markTestSkipped('This test is only intended for version aware platform drivers.');
}
$this->expectException(DBALException::class);
......@@ -152,9 +152,9 @@ abstract class AbstractDriverTest extends TestCase
$connection = $this->getConnectionMock();
$connection->expects($this->once())
$connection->expects(self::once())
->method('getParams')
->will($this->returnValue($params));
->will(self::returnValue($params));
self::assertSame($params['dbname'], $this->driver->getDatabase($connection));
}
......
......@@ -28,19 +28,19 @@ class AbstractMySQLDriverTest extends AbstractDriverTest
$statement = $this->createMock(ResultStatement::class);
$statement->expects($this->once())
$statement->expects(self::once())
->method('fetchColumn')
->will($this->returnValue($database));
->will(self::returnValue($database));
$connection = $this->getConnectionMock();
$connection->expects($this->once())
$connection->expects(self::once())
->method('getParams')
->will($this->returnValue($params));
->will(self::returnValue($params));
$connection->expects($this->once())
$connection->expects(self::once())
->method('query')
->will($this->returnValue($statement));
->will(self::returnValue($statement));
self::assertSame($database, $this->driver->getDatabase($connection));
}
......
......@@ -16,7 +16,7 @@ class EasyConnectStringTest extends TestCase
{
$string = EasyConnectString::fromConnectionParameters($params);
$this->assertSame($expected, (string) $string);
self::assertSame($expected, (string) $string);
}
/**
......
......@@ -22,9 +22,9 @@ class AbstractOracleDriverTest extends AbstractDriverTest
$connection = $this->getConnectionMock();
$connection->expects($this->once())
$connection->expects(self::once())
->method('getParams')
->will($this->returnValue($params));
->will(self::returnValue($params));
self::assertSame($params['user'], $this->driver->getDatabase($connection));
}
......@@ -41,9 +41,9 @@ class AbstractOracleDriverTest extends AbstractDriverTest
$connection = $this->getConnectionMock();
$connection->expects($this->once())
$connection->expects(self::once())
->method('getParams')
->will($this->returnValue($params));
->will(self::returnValue($params));
self::assertSame($params['user'], $this->driver->getDatabase($connection));
}
......
......@@ -26,19 +26,19 @@ class AbstractPostgreSQLDriverTest extends AbstractDriverTest
$statement = $this->createMock(ResultStatement::class);
$statement->expects($this->once())
$statement->expects(self::once())
->method('fetchColumn')
->will($this->returnValue($database));
->will(self::returnValue($database));
$connection = $this->getConnectionMock();
$connection->expects($this->once())
$connection->expects(self::once())
->method('getParams')
->will($this->returnValue($params));
->will(self::returnValue($params));
$connection->expects($this->once())
$connection->expects(self::once())
->method('query')
->will($this->returnValue($statement));
->will(self::returnValue($statement));
self::assertSame($database, $this->driver->getDatabase($connection));
}
......
......@@ -23,9 +23,9 @@ class AbstractSQLiteDriverTest extends AbstractDriverTest
$connection = $this->getConnectionMock();
$connection->expects($this->once())
$connection->expects(self::once())
->method('getParams')
->will($this->returnValue($params));
->will(self::returnValue($params));
self::assertSame($params['path'], $this->driver->getDatabase($connection));
}
......
......@@ -23,7 +23,7 @@ class MysqliConnectionTest extends FunctionalTestCase
protected function setUp() : void
{
if (! extension_loaded('mysqli')) {
$this->markTestSkipped('mysqli is not installed.');
self::markTestSkipped('mysqli is not installed.');
}
parent::setUp();
......
......@@ -40,23 +40,23 @@ class OCI8StatementTest extends TestCase
->disableOriginalConstructor()
->getMock();
$statement->expects($this->at(0))
$statement->expects(self::at(0))
->method('bindValue')
->with(
$this->equalTo(1),
$this->equalTo($params[0])
self::equalTo(1),
self::equalTo($params[0])
);
$statement->expects($this->at(1))
$statement->expects(self::at(1))
->method('bindValue')
->with(
$this->equalTo(2),
$this->equalTo($params[1])
self::equalTo(2),
self::equalTo($params[1])
);
$statement->expects($this->at(2))
$statement->expects(self::at(2))
->method('bindValue')
->with(
$this->equalTo(3),
$this->equalTo($params[2])
self::equalTo(3),
self::equalTo($params[2])
);
// the return value is irrelevant to the test
......@@ -70,7 +70,7 @@ class OCI8StatementTest extends TestCase
->onlyMethods(['getExecuteMode'])
->disableOriginalConstructor()
->getMock();
$conn->expects($this->once())
$conn->expects(self::once())
->method('getExecuteMode');
$reflProperty = new ReflectionProperty($statement, '_conn');
......
......@@ -25,9 +25,9 @@ class StatementIteratorTest extends TestCase
{
/** @var IteratorAggregate|MockObject $stmt */
$stmt = $this->createPartialMock($class, ['fetch', 'fetchAll', 'fetchColumn']);
$stmt->expects($this->never())->method('fetch');
$stmt->expects($this->never())->method('fetchAll');
$stmt->expects($this->never())->method('fetchColumn');
$stmt->expects(self::never())->method('fetch');
$stmt->expects(self::never())->method('fetchAll');
$stmt->expects(self::never())->method('fetchColumn');
$stmt->getIterator();
}
......@@ -61,7 +61,7 @@ class StatementIteratorTest extends TestCase
$values = ['foo', '', 'bar', '0', 'baz', 0, 'qux', null, 'quz', false, 'impossible'];
$calls = 0;
$stmt->expects($this->exactly(10))
$stmt->expects(self::exactly(10))
->method('fetch')
->willReturnCallback(static function () use ($values, &$calls) {
$value = $values[$calls];
......@@ -74,7 +74,7 @@ class StatementIteratorTest extends TestCase
private function assertIterationCallsFetchOncePerStep(Traversable $iterator, int &$calls) : void
{
foreach ($iterator as $i => $_) {
$this->assertEquals($i + 1, $calls);
self::assertEquals($i + 1, $calls);
}
}
......
......@@ -13,9 +13,9 @@ class MysqlSessionInitTest extends TestCase
public function testPostConnect() : void
{
$connectionMock = $this->createMock(Connection::class);
$connectionMock->expects($this->once())
$connectionMock->expects(self::once())
->method('executeUpdate')
->with($this->equalTo('SET NAMES foo COLLATE bar'));
->with(self::equalTo('SET NAMES foo COLLATE bar'));
$eventArgs = new ConnectionEventArgs($connectionMock);
......
......@@ -14,9 +14,9 @@ class OracleSessionInitTest extends TestCase
public function testPostConnect() : void
{
$connectionMock = $this->createMock(Connection::class);
$connectionMock->expects($this->once())
$connectionMock->expects(self::once())
->method('executeUpdate')
->with($this->isType('string'));
->with(self::isType('string'));
$eventArgs = new ConnectionEventArgs($connectionMock);
......@@ -33,9 +33,9 @@ class OracleSessionInitTest extends TestCase
$connectionMock = $this->getMockBuilder(Connection::class)
->disableOriginalConstructor()
->getMock();
$connectionMock->expects($this->once())
$connectionMock->expects(self::once())
->method('executeUpdate')
->with($this->stringContains(sprintf('%s = %s', $name, $value)));
->with(self::stringContains(sprintf('%s = %s', $name, $value)));
$eventArgs = new ConnectionEventArgs($connectionMock);
......
......@@ -16,9 +16,9 @@ class SQLSessionInitTest extends TestCase
public function testPostConnect() : void
{
$connectionMock = $this->createMock(Connection::class);
$connectionMock->expects($this->once())
$connectionMock->expects(self::once())
->method('exec')
->with($this->equalTo("SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'"));
->with(self::equalTo("SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'"));
$eventArgs = new ConnectionEventArgs($connectionMock);
......
......@@ -25,7 +25,7 @@ class BlobTest extends FunctionalTestCase
if ($this->connection->getDriver() instanceof PDOOracleDriver) {
// inserting BLOBs as streams on Oracle requires Oracle-specific SQL syntax which is currently not supported
// see http://php.net/manual/en/pdo.lobs.php#example-1035
$this->markTestSkipped('DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI');
self::markTestSkipped('DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI');
}
$table = new Table('blob_table');
......@@ -57,7 +57,7 @@ class BlobTest extends FunctionalTestCase
{
// https://github.com/doctrine/dbal/issues/3290
if ($this->connection->getDriver() instanceof OCI8Driver) {
$this->markTestIncomplete('The oci8 driver does not support stream resources as parameters');
self::markTestIncomplete('The oci8 driver does not support stream resources as parameters');
}
$longBlob = str_repeat('x', 4 * 8192); // send 4 chunks
......@@ -113,7 +113,7 @@ class BlobTest extends FunctionalTestCase
{
// https://github.com/doctrine/dbal/issues/3290
if ($this->connection->getDriver() instanceof OCI8Driver) {
$this->markTestIncomplete('The oci8 driver does not support stream resources as parameters');
self::markTestIncomplete('The oci8 driver does not support stream resources as parameters');
}
$this->connection->insert('blob_table', [
......@@ -140,7 +140,7 @@ class BlobTest extends FunctionalTestCase
public function testBindParamProcessesStream() : void
{
if ($this->connection->getDriver() instanceof OCI8Driver) {
$this->markTestIncomplete('The oci8 driver does not support stream resources as parameters');
self::markTestIncomplete('The oci8 driver does not support stream resources as parameters');
}
$stmt = $this->connection->prepare("INSERT INTO blob_table(id, clobfield, blobfield) VALUES (1, 'ignored', ?)");
......
......@@ -74,7 +74,7 @@ class ConnectionTest extends FunctionalTestCase
self::assertTrue($this->connection->isRollbackOnly());
$this->connection->commit(); // should throw exception
$this->fail('Transaction commit after failed nested transaction should fail.');
self::fail('Transaction commit after failed nested transaction should fail.');
} catch (ConnectionException $e) {
self::assertEquals(1, $this->connection->getTransactionNestingLevel());
$this->connection->rollBack();
......@@ -119,7 +119,7 @@ class ConnectionTest extends FunctionalTestCase
public function testTransactionNestingBehaviorWithSavepoints() : void
{
if (! $this->connection->getDatabasePlatform()->supportsSavepoints()) {
$this->markTestSkipped('This test requires the platform to support savepoints.');
self::markTestSkipped('This test requires the platform to support savepoints.');
}
$this->connection->setNestTransactionsWithSavepoints(true);
......@@ -144,21 +144,20 @@ class ConnectionTest extends FunctionalTestCase
self::assertFalse($this->connection->isRollbackOnly());
try {
$this->connection->setNestTransactionsWithSavepoints(false);
$this->fail('Should not be able to disable savepoints in usage for nested transactions inside an open transaction.');
self::fail('Should not be able to disable savepoints in usage for nested transactions inside an open transaction.');
} catch (ConnectionException $e) {
self::assertTrue($this->connection->getNestTransactionsWithSavepoints());
}
$this->connection->commit(); // should not throw exception
} catch (ConnectionException $e) {
$this->fail('Transaction commit after failed nested transaction should not fail when using savepoints.');
$this->connection->rollBack();
self::fail('Transaction commit after failed nested transaction should not fail when using savepoints.');
}
}
public function testTransactionNestingBehaviorCantBeChangedInActiveTransaction() : void
{
if (! $this->connection->getDatabasePlatform()->supportsSavepoints()) {
$this->markTestSkipped('This test requires the platform to support savepoints.');
self::markTestSkipped('This test requires the platform to support savepoints.');
}
$this->connection->beginTransaction();
......@@ -169,7 +168,7 @@ class ConnectionTest extends FunctionalTestCase
public function testSetNestedTransactionsThroughSavepointsNotSupportedThrowsException() : void
{
if ($this->connection->getDatabasePlatform()->supportsSavepoints()) {
$this->markTestSkipped('This test requires the platform not to support savepoints.');
self::markTestSkipped('This test requires the platform not to support savepoints.');
}
$this->expectException(ConnectionException::class);
......@@ -181,7 +180,7 @@ class ConnectionTest extends FunctionalTestCase
public function testCreateSavepointsNotSupportedThrowsException() : void
{
if ($this->connection->getDatabasePlatform()->supportsSavepoints()) {
$this->markTestSkipped('This test requires the platform not to support savepoints.');
self::markTestSkipped('This test requires the platform not to support savepoints.');
}
$this->expectException(ConnectionException::class);
......@@ -193,7 +192,7 @@ class ConnectionTest extends FunctionalTestCase
public function testReleaseSavepointsNotSupportedThrowsException() : void
{
if ($this->connection->getDatabasePlatform()->supportsSavepoints()) {
$this->markTestSkipped('This test requires the platform not to support savepoints.');
self::markTestSkipped('This test requires the platform not to support savepoints.');
}
$this->expectException(ConnectionException::class);
......@@ -205,7 +204,7 @@ class ConnectionTest extends FunctionalTestCase
public function testRollbackSavepointsNotSupportedThrowsException() : void
{
if ($this->connection->getDatabasePlatform()->supportsSavepoints()) {
$this->markTestSkipped('This test requires the platform not to support savepoints.');
self::markTestSkipped('This test requires the platform not to support savepoints.');
}
$this->expectException(ConnectionException::class);
......@@ -252,7 +251,7 @@ class ConnectionTest extends FunctionalTestCase
$conn->executeQuery($conn->getDatabasePlatform()->getDummySelectSQL());
throw new RuntimeException('Ooops!');
});
$this->fail('Expected exception');
self::fail('Expected exception');
} catch (RuntimeException $expected) {
self::assertEquals(0, $this->connection->getTransactionNestingLevel());
}
......@@ -266,7 +265,7 @@ class ConnectionTest extends FunctionalTestCase
$conn->executeQuery($conn->getDatabasePlatform()->getDummySelectSQL());
throw new Error('Ooops!');
});
$this->fail('Expected exception');
self::fail('Expected exception');
} catch (Error $expected) {
self::assertEquals(0, $this->connection->getTransactionNestingLevel());
}
......@@ -314,7 +313,7 @@ class ConnectionTest extends FunctionalTestCase
public function testConnectWithoutExplicitDatabaseName() : void
{
if (in_array($this->connection->getDatabasePlatform()->getName(), ['oracle', 'db2'], true)) {
$this->markTestSkipped('Platform does not support connecting without database name.');
self::markTestSkipped('Platform does not support connecting without database name.');
}
$params = $this->connection->getParams();
......@@ -337,7 +336,7 @@ class ConnectionTest extends FunctionalTestCase
public function testDeterminesDatabasePlatformWhenConnectingToNonExistentDatabase() : void
{
if (in_array($this->connection->getDatabasePlatform()->getName(), ['oracle', 'db2'], true)) {
$this->markTestSkipped('Platform does not support connecting without database name.');
self::markTestSkipped('Platform does not support connecting without database name.');
}
$params = $this->connection->getParams();
......
......@@ -248,7 +248,7 @@ class DataAccessTest extends FunctionalTestCase
{
if ($this->connection->getDriver() instanceof MySQLiDriver ||
$this->connection->getDriver() instanceof SQLSrvDriver) {
$this->markTestSkipped('mysqli and sqlsrv actually supports this');
self::markTestSkipped('mysqli and sqlsrv actually supports this');
}
$datetimeString = '2010-01-01 10:10:10';
......@@ -319,7 +319,7 @@ class DataAccessTest extends FunctionalTestCase
{
if ($this->connection->getDriver() instanceof MySQLiDriver ||
$this->connection->getDriver() instanceof SQLSrvDriver) {
$this->markTestSkipped('mysqli and sqlsrv actually supports this');
self::markTestSkipped('mysqli and sqlsrv actually supports this');
}
$datetimeString = '2010-01-01 10:10:10';
......@@ -364,7 +364,7 @@ class DataAccessTest extends FunctionalTestCase
{
if ($this->connection->getDriver() instanceof MySQLiDriver ||
$this->connection->getDriver() instanceof SQLSrvDriver) {
$this->markTestSkipped('mysqli and sqlsrv actually supports this');
self::markTestSkipped('mysqli and sqlsrv actually supports this');
}
$datetimeString = '2010-01-01 10:10:10';
......@@ -411,7 +411,7 @@ class DataAccessTest extends FunctionalTestCase
{
if ($this->connection->getDriver() instanceof MySQLiDriver ||
$this->connection->getDriver() instanceof SQLSrvDriver) {
$this->markTestSkipped('mysqli and sqlsrv actually supports this');
self::markTestSkipped('mysqli and sqlsrv actually supports this');
}
$datetimeString = '2010-01-01 10:10:10';
......@@ -620,7 +620,7 @@ class DataAccessTest extends FunctionalTestCase
$platform = $this->connection->getDatabasePlatform();
if (! $platform instanceof SqlitePlatform) {
$this->markTestSkipped('test is for sqlite only');
self::markTestSkipped('test is for sqlite only');
}
$table = new Table('fetch_table_date_math');
......@@ -639,7 +639,7 @@ class DataAccessTest extends FunctionalTestCase
$rowCount = $this->connection->fetchColumn($sql, [], 0);
$this->assertEquals(1, $rowCount);
self::assertEquals(1, $rowCount);
}
public function testLocateExpression() : void
......@@ -942,11 +942,11 @@ class DataAccessTest extends FunctionalTestCase
$driver = $this->connection->getDriver();
if ($driver instanceof Oci8Driver) {
$this->markTestSkipped('Not supported by OCI8');
self::markTestSkipped('Not supported by OCI8');
}
if ($driver instanceof MySQLiDriver) {
$this->markTestSkipped('Mysqli driver dont support this feature.');
self::markTestSkipped('Mysqli driver dont support this feature.');
}
if (! $driver instanceof PDOOracleDriver) {
......
......@@ -12,7 +12,7 @@ class DB2DriverTest extends AbstractDriverTest
protected function setUp() : void
{
if (! extension_loaded('ibm_db2')) {
$this->markTestSkipped('ibm_db2 is not installed.');
self::markTestSkipped('ibm_db2 is not installed.');
}
parent::setUp();
......@@ -21,7 +21,7 @@ class DB2DriverTest extends AbstractDriverTest
return;
}
$this->markTestSkipped('ibm_db2 only test.');
self::markTestSkipped('ibm_db2 only test.');
}
/**
......@@ -29,7 +29,7 @@ class DB2DriverTest extends AbstractDriverTest
*/
public function testConnectsWithoutDatabaseNameParameter() : void
{
$this->markTestSkipped('IBM DB2 does not support connecting without database name.');
self::markTestSkipped('IBM DB2 does not support connecting without database name.');
}
/**
......@@ -37,7 +37,7 @@ class DB2DriverTest extends AbstractDriverTest
*/
public function testReturnsDatabaseNameWithoutDatabaseNameParameter() : void
{
$this->markTestSkipped('IBM DB2 does not support connecting without database name.');
self::markTestSkipped('IBM DB2 does not support connecting without database name.');
}
/**
......
......@@ -13,7 +13,7 @@ class DB2StatementTest extends FunctionalTestCase
protected function setUp() : void
{
if (! extension_loaded('ibm_db2')) {
$this->markTestSkipped('ibm_db2 is not installed.');
self::markTestSkipped('ibm_db2 is not installed.');
}
parent::setUp();
......@@ -22,7 +22,7 @@ class DB2StatementTest extends FunctionalTestCase
return;
}
$this->markTestSkipped('ibm_db2 only test.');
self::markTestSkipped('ibm_db2 only test.');
}
public function testExecutionErrorsAreNotSuppressed() : void
......
......@@ -14,7 +14,7 @@ class ConnectionTest extends FunctionalTestCase
protected function setUp() : void
{
if (! extension_loaded('mysqli')) {
$this->markTestSkipped('mysqli is not installed.');
self::markTestSkipped('mysqli is not installed.');
}
parent::setUp();
......@@ -23,7 +23,7 @@ class ConnectionTest extends FunctionalTestCase
return;
}
$this->markTestSkipped('MySQLi only test.');
self::markTestSkipped('MySQLi only test.');
}
protected function tearDown() : void
......
......@@ -12,7 +12,7 @@ class DriverTest extends AbstractDriverTest
protected function setUp() : void
{
if (! extension_loaded('mysqli')) {
$this->markTestSkipped('mysqli is not installed.');
self::markTestSkipped('mysqli is not installed.');
}
parent::setUp();
......@@ -21,7 +21,7 @@ class DriverTest extends AbstractDriverTest
return;
}
$this->markTestSkipped('MySQLi only test.');
self::markTestSkipped('MySQLi only test.');
}
/**
......
......@@ -12,7 +12,7 @@ class DriverTest extends AbstractDriverTest
protected function setUp() : void
{
if (! extension_loaded('oci8')) {
$this->markTestSkipped('oci8 is not installed.');
self::markTestSkipped('oci8 is not installed.');
}
parent::setUp();
......@@ -21,7 +21,7 @@ class DriverTest extends AbstractDriverTest
return;
}
$this->markTestSkipped('oci8 only test.');
self::markTestSkipped('oci8 only test.');
}
/**
......@@ -29,7 +29,7 @@ class DriverTest extends AbstractDriverTest
*/
public function testConnectsWithoutDatabaseNameParameter() : void
{
$this->markTestSkipped('Oracle does not support connecting without database name.');
self::markTestSkipped('Oracle does not support connecting without database name.');
}
/**
......@@ -37,7 +37,7 @@ class DriverTest extends AbstractDriverTest
*/
public function testReturnsDatabaseNameWithoutDatabaseNameParameter() : void
{
$this->markTestSkipped('Oracle does not support connecting without database name.');
self::markTestSkipped('Oracle does not support connecting without database name.');
}
/**
......
......@@ -16,13 +16,13 @@ class OCI8ConnectionTest extends FunctionalTestCase
protected function setUp() : void
{
if (! extension_loaded('oci8')) {
$this->markTestSkipped('oci8 is not installed.');
self::markTestSkipped('oci8 is not installed.');
}
parent::setUp();
if (! $this->connection->getDriver() instanceof Driver) {
$this->markTestSkipped('oci8 only test.');
self::markTestSkipped('oci8 only test.');
}
$this->driverConnection = $this->connection->getWrappedConnection();
......
......@@ -11,7 +11,7 @@ class StatementTest extends FunctionalTestCase
protected function setUp() : void
{
if (! extension_loaded('oci8')) {
$this->markTestSkipped('oci8 is not installed.');
self::markTestSkipped('oci8 is not installed.');
}
parent::setUp();
......@@ -20,7 +20,7 @@ class StatementTest extends FunctionalTestCase
return;
}
$this->markTestSkipped('oci8 only test.');
self::markTestSkipped('oci8 only test.');
}
/**
......
......@@ -34,7 +34,7 @@ class PDOConnectionTest extends FunctionalTestCase
return;
}
$this->markTestSkipped('PDO connection only test.');
self::markTestSkipped('PDO connection only test.');
}
protected function tearDown() : void
......@@ -71,7 +71,7 @@ class PDOConnectionTest extends FunctionalTestCase
$driver = $this->connection->getDriver();
if ($driver instanceof PDOSQLSRVDriver) {
$this->markTestSkipped('pdo_sqlsrv does not allow setting PDO::ATTR_EMULATE_PREPARES at connection level.');
self::markTestSkipped('pdo_sqlsrv does not allow setting PDO::ATTR_EMULATE_PREPARES at connection level.');
}
// Some PDO adapters do not check the query server-side
......
......@@ -12,7 +12,7 @@ class DriverTest extends AbstractDriverTest
protected function setUp() : void
{
if (! extension_loaded('pdo_mysql')) {
$this->markTestSkipped('pdo_mysql is not installed.');
self::markTestSkipped('pdo_mysql is not installed.');
}
parent::setUp();
......@@ -21,7 +21,7 @@ class DriverTest extends AbstractDriverTest
return;
}
$this->markTestSkipped('pdo_mysql only test.');
self::markTestSkipped('pdo_mysql only test.');
}
/**
......
......@@ -12,7 +12,7 @@ class DriverTest extends AbstractDriverTest
protected function setUp() : void
{
if (! extension_loaded('PDO_OCI')) {
$this->markTestSkipped('PDO_OCI is not installed.');
self::markTestSkipped('PDO_OCI is not installed.');
}
parent::setUp();
......@@ -21,7 +21,7 @@ class DriverTest extends AbstractDriverTest
return;
}
$this->markTestSkipped('PDO_OCI only test.');
self::markTestSkipped('PDO_OCI only test.');
}
/**
......@@ -29,7 +29,7 @@ class DriverTest extends AbstractDriverTest
*/
public function testConnectsWithoutDatabaseNameParameter() : void
{
$this->markTestSkipped('Oracle does not support connecting without database name.');
self::markTestSkipped('Oracle does not support connecting without database name.');
}
/**
......@@ -37,7 +37,7 @@ class DriverTest extends AbstractDriverTest
*/
public function testReturnsDatabaseNameWithoutDatabaseNameParameter() : void
{
$this->markTestSkipped('Oracle does not support connecting without database name.');
self::markTestSkipped('Oracle does not support connecting without database name.');
}
/**
......
......@@ -17,7 +17,7 @@ class DriverTest extends AbstractDriverTest
protected function setUp() : void
{
if (! extension_loaded('pdo_pgsql')) {
$this->markTestSkipped('pdo_pgsql is not installed.');
self::markTestSkipped('pdo_pgsql is not installed.');
}
parent::setUp();
......@@ -26,7 +26,7 @@ class DriverTest extends AbstractDriverTest
return;
}
$this->markTestSkipped('pdo_pgsql only test.');
self::markTestSkipped('pdo_pgsql only test.');
}
/**
......@@ -98,7 +98,7 @@ class DriverTest extends AbstractDriverTest
}
}
$this->fail(sprintf('Query result does not contain a record where column "query" equals "%s".', $sql));
self::fail(sprintf('Query result does not contain a record where column "query" equals "%s".', $sql));
}
/**
......
......@@ -13,7 +13,7 @@ class PDOPgsqlConnectionTest extends FunctionalTestCase
protected function setUp() : void
{
if (! extension_loaded('pdo_pgsql')) {
$this->markTestSkipped('pdo_pgsql is not loaded.');
self::markTestSkipped('pdo_pgsql is not loaded.');
}
parent::setUp();
......@@ -22,7 +22,7 @@ class PDOPgsqlConnectionTest extends FunctionalTestCase
return;
}
$this->markTestSkipped('PDOPgsql only test.');
self::markTestSkipped('PDOPgsql only test.');
}
/**
......
......@@ -12,7 +12,7 @@ class DriverTest extends AbstractDriverTest
protected function setUp() : void
{
if (! extension_loaded('pdo_sqlite')) {
$this->markTestSkipped('pdo_sqlite is not installed.');
self::markTestSkipped('pdo_sqlite is not installed.');
}
parent::setUp();
......@@ -21,7 +21,7 @@ class DriverTest extends AbstractDriverTest
return;
}
$this->markTestSkipped('pdo_sqlite only test.');
self::markTestSkipped('pdo_sqlite only test.');
}
/**
......
......@@ -16,7 +16,7 @@ class DriverTest extends AbstractDriverTest
protected function setUp() : void
{
if (! extension_loaded('pdo_sqlsrv')) {
$this->markTestSkipped('pdo_sqlsrv is not installed.');
self::markTestSkipped('pdo_sqlsrv is not installed.');
}
parent::setUp();
......@@ -25,7 +25,7 @@ class DriverTest extends AbstractDriverTest
return;
}
$this->markTestSkipped('pdo_sqlsrv only test.');
self::markTestSkipped('pdo_sqlsrv only test.');
}
/**
......
......@@ -12,7 +12,7 @@ class ConnectionTest extends FunctionalTestCase
protected function setUp() : void
{
if (! extension_loaded('sqlanywhere')) {
$this->markTestSkipped('sqlanywhere is not installed.');
self::markTestSkipped('sqlanywhere is not installed.');
}
parent::setUp();
......@@ -21,7 +21,7 @@ class ConnectionTest extends FunctionalTestCase
return;
}
$this->markTestSkipped('sqlanywhere only test.');
self::markTestSkipped('sqlanywhere only test.');
}
public function testNonPersistentConnection() : void
......
......@@ -13,7 +13,7 @@ class DriverTest extends AbstractDriverTest
protected function setUp() : void
{
if (! extension_loaded('sqlanywhere')) {
$this->markTestSkipped('sqlanywhere is not installed.');
self::markTestSkipped('sqlanywhere is not installed.');
}
parent::setUp();
......@@ -22,7 +22,7 @@ class DriverTest extends AbstractDriverTest
return;
}
$this->markTestSkipped('sqlanywhere only test.');
self::markTestSkipped('sqlanywhere only test.');
}
public function testReturnsDatabaseNameWithoutDatabaseNameParameter() : void
......
......@@ -12,7 +12,7 @@ class StatementTest extends FunctionalTestCase
protected function setUp() : void
{
if (! extension_loaded('sqlanywhere')) {
$this->markTestSkipped('sqlanywhere is not installed.');
self::markTestSkipped('sqlanywhere is not installed.');
}
parent::setUp();
......@@ -21,7 +21,7 @@ class StatementTest extends FunctionalTestCase
return;
}
$this->markTestSkipped('sqlanywhere only test.');
self::markTestSkipped('sqlanywhere only test.');
}
public function testNonPersistentStatement() : void
......
......@@ -12,7 +12,7 @@ class DriverTest extends AbstractDriverTest
protected function setUp() : void
{
if (! extension_loaded('sqlsrv')) {
$this->markTestSkipped('sqlsrv is not installed.');
self::markTestSkipped('sqlsrv is not installed.');
}
parent::setUp();
......@@ -21,7 +21,7 @@ class DriverTest extends AbstractDriverTest
return;
}
$this->markTestSkipped('sqlsrv only test.');
self::markTestSkipped('sqlsrv only test.');
}
/**
......
......@@ -37,7 +37,7 @@ class ExceptionTest extends FunctionalTestCase
return;
}
$this->markTestSkipped('Driver does not support special exception handling.');
self::markTestSkipped('Driver does not support special exception handling.');
}
public function testPrimaryConstraintViolationException() : void
......@@ -296,7 +296,7 @@ class ExceptionTest extends FunctionalTestCase
public function testConnectionExceptionSqLite() : void
{
if (! ($this->connection->getDatabasePlatform() instanceof SqlitePlatform)) {
$this->markTestSkipped('Only fails this way on sqlite');
self::markTestSkipped('Only fails this way on sqlite');
}
// mode 0 is considered read-only on Windows
......@@ -353,11 +353,11 @@ EOT
$platform = $this->connection->getDatabasePlatform();
if ($platform instanceof SqlitePlatform) {
$this->markTestSkipped('Only skipped if platform is not sqlite');
self::markTestSkipped('Only skipped if platform is not sqlite');
}
if ($platform instanceof PostgreSQL94Platform && isset($params['password'])) {
$this->markTestSkipped('Does not work on Travis');
self::markTestSkipped('Does not work on Travis');
}
if ($platform instanceof MySqlPlatform && isset($params['user'])) {
......@@ -365,7 +365,7 @@ EOT
assert($wrappedConnection instanceof ServerInfoAwareConnection);
if (version_compare($wrappedConnection->getServerVersion(), '8', '>=')) {
$this->markTestIncomplete('PHP currently does not completely support MySQL 8');
self::markTestIncomplete('PHP currently does not completely support MySQL 8');
}
}
......
......@@ -23,6 +23,6 @@ final class LikeWildcardsEscapingTest extends FunctionalTestCase
)
);
$stmt->execute();
$this->assertTrue((bool) $stmt->fetchColumn());
self::assertTrue((bool) $stmt->fetchColumn());
}
}
......@@ -12,10 +12,10 @@ class LoggingTest extends FunctionalTestCase
$sql = $this->connection->getDatabasePlatform()->getDummySelectSQL();
$logMock = $this->createMock(SQLLogger::class);
$logMock->expects($this->at(0))
$logMock->expects(self::at(0))
->method('startQuery')
->with($this->equalTo($sql), $this->equalTo([]), $this->equalTo([]));
$logMock->expects($this->at(1))
->with(self::equalTo($sql), self::equalTo([]), self::equalTo([]));
$logMock->expects(self::at(1))
->method('stopQuery');
$this->connection->getConfiguration()->setSQLLogger($logMock);
$this->connection->executeQuery($sql, []);
......@@ -28,10 +28,10 @@ class LoggingTest extends FunctionalTestCase
$sql = $this->connection->getDatabasePlatform()->getDummySelectSQL();
$logMock = $this->createMock(SQLLogger::class);
$logMock->expects($this->at(0))
$logMock->expects(self::at(0))
->method('startQuery')
->with($this->equalTo($sql), $this->equalTo([]), $this->equalTo([]));
$logMock->expects($this->at(1))
->with(self::equalTo($sql), self::equalTo([]), self::equalTo([]));
$logMock->expects(self::at(1))
->method('stopQuery');
$this->connection->getConfiguration()->setSQLLogger($logMock);
$this->connection->executeUpdate($sql, []);
......@@ -42,10 +42,10 @@ class LoggingTest extends FunctionalTestCase
$sql = $this->connection->getDatabasePlatform()->getDummySelectSQL();
$logMock = $this->createMock(SQLLogger::class);
$logMock->expects($this->once())
$logMock->expects(self::once())
->method('startQuery')
->with($this->equalTo($sql), $this->equalTo([]));
$logMock->expects($this->at(1))
->with(self::equalTo($sql), self::equalTo([]));
$logMock->expects(self::at(1))
->method('stopQuery');
$this->connection->getConfiguration()->setSQLLogger($logMock);
......
......@@ -28,7 +28,7 @@ class MasterSlaveConnectionTest extends FunctionalTestCase
// This is a MySQL specific test, skip other vendors.
if ($platformName !== 'mysql') {
$this->markTestSkipped(sprintf('Test does not work on %s.', $platformName));
self::markTestSkipped(sprintf('Test does not work on %s.', $platformName));
}
try {
......
......@@ -199,7 +199,7 @@ class NamedParametersTest extends FunctionalTestCase
'bar' => 2,
]);
} catch (Throwable $e) {
$this->fail($e->getMessage());
self::fail($e->getMessage());
}
}
......
......@@ -20,7 +20,7 @@ final class NewPrimaryKeyWithNewAutoIncrementColumnTest extends FunctionalTestCa
return;
}
$this->markTestSkipped('Restricted to MySQL.');
self::markTestSkipped('Restricted to MySQL.');
}
/**
......@@ -57,10 +57,10 @@ final class NewPrimaryKeyWithNewAutoIncrementColumnTest extends FunctionalTestCa
$validationSchema = $schemaManager->createSchema();
$validationTable = $validationSchema->getTable($table->getName());
$this->assertTrue($validationTable->hasColumn('new_id'));
$this->assertTrue($validationTable->getColumn('new_id')->getAutoincrement());
$this->assertTrue($validationTable->hasPrimaryKey());
$this->assertSame(['new_id'], $validationTable->getPrimaryKeyColumns());
self::assertTrue($validationTable->hasColumn('new_id'));
self::assertTrue($validationTable->getColumn('new_id')->getAutoincrement());
self::assertTrue($validationTable->hasPrimaryKey());
self::assertSame(['new_id'], $validationTable->getPrimaryKeyColumns());
}
private function getPlatform() : AbstractPlatform
......
......@@ -178,7 +178,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public function testDoesNotPropagateDefaultValuesForUnsupportedColumnTypes() : void
{
if ($this->schemaManager->getDatabasePlatform() instanceof MariaDb1027Platform) {
$this->markTestSkipped(
self::markTestSkipped(
'MariaDb102Platform supports default values for BLOB and TEXT columns and will propagate values'
);
}
......@@ -489,7 +489,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public function testColumnDefaultValuesCurrentTimeAndDate() : void
{
if (! $this->schemaManager->getDatabasePlatform() instanceof MariaDb1027Platform) {
$this->markTestSkipped('Only relevant for MariaDb102Platform.');
self::markTestSkipped('Only relevant for MariaDb102Platform.');
}
$platform = $this->schemaManager->getDatabasePlatform();
......
......@@ -224,7 +224,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public function testListForeignKeys() : void
{
if (! $this->connection->getDatabasePlatform()->supportsForeignKeyConstraints()) {
$this->markTestSkipped('Does not support foreign key constraints.');
self::markTestSkipped('Does not support foreign key constraints.');
}
$fkOptions = ['SET NULL', 'SET DEFAULT', 'NO ACTION','CASCADE', 'RESTRICT'];
......
......@@ -162,12 +162,12 @@ EOS
public function testNonDefaultPKOrder() : void
{
if (! extension_loaded('sqlite3')) {
$this->markTestSkipped('This test requires the SQLite3 extension.');
self::markTestSkipped('This test requires the SQLite3 extension.');
}
$version = SQLite3::version();
if (version_compare($version['versionString'], '3.7.16', '<')) {
$this->markTestSkipped('This version of sqlite doesn\'t return the order of the Primary Key.');
self::markTestSkipped('This version of sqlite doesn\'t return the order of the Primary Key.');
}
$this->connection->exec(<<<EOS
CREATE TABLE non_default_pk_order (
......@@ -276,6 +276,6 @@ SQL;
$lastUsedIdAfterDelete = (int) $query->fetchColumn();
// with an empty table, non autoincrement rowid is always 1
$this->assertEquals(1, $lastUsedIdAfterDelete);
self::assertEquals(1, $lastUsedIdAfterDelete);
}
}
......@@ -27,7 +27,7 @@ class StatementTest extends FunctionalTestCase
public function testStatementIsReusableAfterClosingCursor() : void
{
if ($this->connection->getDriver() instanceof PDOOracleDriver) {
$this->markTestIncomplete('See https://bugs.php.net/bug.php?id=77181');
self::markTestIncomplete('See https://bugs.php.net/bug.php?id=77181');
}
$this->connection->insert('stmt_test', ['id' => 1]);
......@@ -52,7 +52,7 @@ class StatementTest extends FunctionalTestCase
public function testReuseStatementWithLongerResults() : void
{
if ($this->connection->getDriver() instanceof PDOOracleDriver) {
$this->markTestIncomplete('PDO_OCI doesn\'t support fetching blobs via PDOStatement::fetchAll()');
self::markTestIncomplete('PDO_OCI doesn\'t support fetching blobs via PDOStatement::fetchAll()');
}
$sm = $this->connection->getSchemaManager();
......@@ -91,7 +91,7 @@ class StatementTest extends FunctionalTestCase
if ($this->connection->getDriver() instanceof PDOOracleDriver) {
// inserting BLOBs as streams on Oracle requires Oracle-specific SQL syntax which is currently not supported
// see http://php.net/manual/en/pdo.lobs.php#example-1035
$this->markTestSkipped('DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI');
self::markTestSkipped('DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI');
}
// make sure memory limit is large enough to not cause false positives,
......@@ -154,7 +154,7 @@ EOF
public function testReuseStatementAfterClosingCursor() : void
{
if ($this->connection->getDriver() instanceof PDOOracleDriver) {
$this->markTestIncomplete('See https://bugs.php.net/bug.php?id=77181');
self::markTestIncomplete('See https://bugs.php.net/bug.php?id=77181');
}
$this->connection->insert('stmt_test', ['id' => 1]);
......
......@@ -22,7 +22,7 @@ class TableGeneratorTest extends FunctionalTestCase
$platform = $this->connection->getDatabasePlatform();
if ($platform->getName() === 'sqlite') {
$this->markTestSkipped('TableGenerator does not work with SQLite');
self::markTestSkipped('TableGenerator does not work with SQLite');
}
try {
......
......@@ -38,7 +38,7 @@ class TemporaryTableTest extends FunctionalTestCase
{
if ($this->connection->getDatabasePlatform()->getName() === 'sqlanywhere' ||
$this->connection->getDatabasePlatform()->getName() === 'oracle') {
$this->markTestSkipped('Test does not work on Oracle and SQL Anywhere.');
self::markTestSkipped('Test does not work on Oracle and SQL Anywhere.');
}
$platform = $this->connection->getDatabasePlatform();
......@@ -73,7 +73,7 @@ class TemporaryTableTest extends FunctionalTestCase
{
if ($this->connection->getDatabasePlatform()->getName() === 'sqlanywhere' ||
$this->connection->getDatabasePlatform()->getName() === 'oracle') {
$this->markTestSkipped('Test does not work on Oracle and SQL Anywhere.');
self::markTestSkipped('Test does not work on Oracle and SQL Anywhere.');
}
$platform = $this->connection->getDatabasePlatform();
......
......@@ -13,7 +13,7 @@ class DBAL168Test extends FunctionalTestCase
public function testDomainsTable() : void
{
if ($this->connection->getDatabasePlatform()->getName() !== 'postgresql') {
$this->markTestSkipped('PostgreSQL only test');
self::markTestSkipped('PostgreSQL only test');
}
$table = new Table('domains');
......
......@@ -15,7 +15,7 @@ class DBAL202Test extends FunctionalTestCase
parent::setUp();
if ($this->connection->getDatabasePlatform()->getName() !== 'oracle') {
$this->markTestSkipped('OCI8 only test');
self::markTestSkipped('OCI8 only test');
}
if ($this->connection->getSchemaManager()->tablesExist('DBAL202')) {
......
......@@ -36,6 +36,6 @@ class DBAL461Test extends TestCase
'comment' => null,
]);
$this->assertInstanceOf(DecimalType::class, $column->getType());
self::assertInstanceOf(DecimalType::class, $column->getType());
}
}
......@@ -19,7 +19,7 @@ class DBAL510Test extends FunctionalTestCase
return;
}
$this->markTestSkipped('PostgreSQL Only test');
self::markTestSkipped('PostgreSQL Only test');
}
public function testSearchPathSchemaChanges() : void
......
......@@ -23,7 +23,7 @@ class DBAL630Test extends FunctionalTestCase
$platform = $this->connection->getDatabasePlatform()->getName();
if (! in_array($platform, ['postgresql'])) {
$this->markTestSkipped('Currently restricted to PostgreSQL');
self::markTestSkipped('Currently restricted to PostgreSQL');
}
try {
......
......@@ -20,7 +20,7 @@ class DBAL752Test extends FunctionalTestCase
return;
}
$this->markTestSkipped('Related to SQLite only');
self::markTestSkipped('Related to SQLite only');
}
public function testUnsignedIntegerDetection() : void
......
......@@ -30,10 +30,10 @@ class TransactionTest extends FunctionalTestCase
{
$this->connection->query('SET SESSION wait_timeout=1');
$this->assertTrue($this->connection->beginTransaction());
self::assertTrue($this->connection->beginTransaction());
sleep(2); // during the sleep mysql will close the connection
$this->assertFalse(@$this->connection->commit()); // we will ignore `MySQL server has gone away` warnings
self::assertFalse(@$this->connection->commit()); // we will ignore `MySQL server has gone away` warnings
}
}
......@@ -122,7 +122,7 @@ class TypeConversionTest extends FunctionalTestCase
if ($type === 'text' && $this->connection->getDriver() instanceof PDOOracleDriver) {
// inserting BLOBs as streams on Oracle requires Oracle-specific SQL syntax which is currently not supported
// see http://php.net/manual/en/pdo.lobs.php#example-1035
$this->markTestSkipped('DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI');
self::markTestSkipped('DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI');
}
$dbValue = $this->processValue($type, $originalValue);
......
......@@ -21,7 +21,7 @@ class BinaryTest extends FunctionalTestCase
parent::setUp();
if ($this->connection->getDriver() instanceof PDOOracleDriver) {
$this->markTestSkipped('PDO_OCI doesn\'t support binding binary values');
self::markTestSkipped('PDO_OCI doesn\'t support binding binary values');
}
$table = new Table('binary_table');
......@@ -53,8 +53,8 @@ class BinaryTest extends FunctionalTestCase
$this->insert($id1, $value1);
$this->insert($id2, $value2);
$this->assertSame($value1, $this->select($id1));
$this->assertSame($value2, $this->select($id2));
self::assertSame($value1, $this->select($id1));
self::assertSame($value2, $this->select($id2));
}
private function insert(string $id, string $value) : void
......
......@@ -146,7 +146,7 @@ class WriteTest extends FunctionalTestCase
public function testLastInsertId() : void
{
if (! $this->connection->getDatabasePlatform()->prefersIdentityColumns()) {
$this->markTestSkipped('Test only works on platforms with identity columns.');
self::markTestSkipped('Test only works on platforms with identity columns.');
}
self::assertEquals(1, $this->connection->insert('write_table', ['test_int' => 2, 'test_string' => 'bar']));
......@@ -159,7 +159,7 @@ class WriteTest extends FunctionalTestCase
public function testLastInsertIdSequence() : void
{
if (! $this->connection->getDatabasePlatform()->supportsSequences()) {
$this->markTestSkipped('Test only works on platforms with sequences.');
self::markTestSkipped('Test only works on platforms with sequences.');
}
$sequence = new Sequence('write_table_id_seq');
......@@ -185,7 +185,7 @@ class WriteTest extends FunctionalTestCase
public function testLastInsertIdNoSequenceGiven() : void
{
if (! $this->connection->getDatabasePlatform()->supportsSequences() || $this->connection->getDatabasePlatform()->supportsIdentityColumns()) {
$this->markTestSkipped("Test only works consistently on platforms that support sequences and don't support identity columns.");
self::markTestSkipped("Test only works consistently on platforms that support sequences and don't support identity columns.");
}
self::assertFalse($this->lastInsertId());
......@@ -260,7 +260,7 @@ class WriteTest extends FunctionalTestCase
$platform = $this->connection->getDatabasePlatform();
if (! ($platform->supportsIdentityColumns() || $platform->usesSequenceEmulatedIdentityColumns())) {
$this->markTestSkipped(
self::markTestSkipped(
'Test only works on platforms with identity columns or sequence emulated identity columns.'
);
}
......@@ -350,7 +350,7 @@ class WriteTest extends FunctionalTestCase
return $this->connection->lastInsertId($name);
} catch (DriverException $e) {
if ($e->getCode() === 'IM001') {
$this->markTestSkipped($e->getMessage());
self::markTestSkipped($e->getMessage());
}
throw $e;
......
......@@ -47,7 +47,7 @@ class LoggerChainTest extends TestCase
private function createLogger(string $method, ...$args) : SQLLogger
{
$logger = $this->createMock(SQLLogger::class);
$logger->expects($this->once())
$logger->expects(self::once())
->method($method)
->with(...$args);
......
......@@ -39,7 +39,7 @@ abstract class AbstractPlatformTestCase extends TestCase
public function testQuoteIdentifier() : void
{
if ($this->platform->getName() === 'mssql') {
$this->markTestSkipped('Not working this way on mssql.');
self::markTestSkipped('Not working this way on mssql.');
}
$c = $this->platform->getIdentifierQuoteCharacter();
......@@ -54,7 +54,7 @@ abstract class AbstractPlatformTestCase extends TestCase
public function testQuoteSingleIdentifier() : void
{
if ($this->platform->getName() === 'mssql') {
$this->markTestSkipped('Not working this way on mssql.');
self::markTestSkipped('Not working this way on mssql.');
}
$c = $this->platform->getIdentifierQuoteCharacter();
......@@ -379,10 +379,10 @@ abstract class AbstractPlatformTestCase extends TestCase
->addMethods(['onSchemaCreateTable', 'onSchemaCreateTableColumn'])
->getMock();
$listenerMock
->expects($this->once())
->expects(self::once())
->method('onSchemaCreateTable');
$listenerMock
->expects($this->exactly(2))
->expects(self::exactly(2))
->method('onSchemaCreateTableColumn');
$eventManager = new EventManager();
......@@ -403,7 +403,7 @@ abstract class AbstractPlatformTestCase extends TestCase
->addMethods(['onSchemaDropTable'])
->getMock();
$listenerMock
->expects($this->once())
->expects(self::once())
->method('onSchemaDropTable');
$eventManager = new EventManager();
......@@ -428,19 +428,19 @@ abstract class AbstractPlatformTestCase extends TestCase
->addMethods($events)
->getMock();
$listenerMock
->expects($this->once())
->expects(self::once())
->method('onSchemaAlterTable');
$listenerMock
->expects($this->once())
->expects(self::once())
->method('onSchemaAlterTableAddColumn');
$listenerMock
->expects($this->once())
->expects(self::once())
->method('onSchemaAlterTableRemoveColumn');
$listenerMock
->expects($this->once())
->expects(self::once())
->method('onSchemaAlterTableChangeColumn');
$listenerMock
->expects($this->once())
->expects(self::once())
->method('onSchemaAlterTableRenameColumn');
$eventManager = new EventManager();
......@@ -533,7 +533,7 @@ abstract class AbstractPlatformTestCase extends TestCase
*/
public function getCreateTableColumnCommentsSQL() : array
{
$this->markTestSkipped('Platform does not support Column comments.');
self::markTestSkipped('Platform does not support Column comments.');
}
/**
......@@ -541,7 +541,7 @@ abstract class AbstractPlatformTestCase extends TestCase
*/
public function getAlterTableColumnCommentsSQL() : array
{
$this->markTestSkipped('Platform does not support Column comments.');
self::markTestSkipped('Platform does not support Column comments.');
}
/**
......@@ -549,7 +549,7 @@ abstract class AbstractPlatformTestCase extends TestCase
*/
public function getCreateTableColumnTypeCommentsSQL() : array
{
$this->markTestSkipped('Platform does not support Column comments.');
self::markTestSkipped('Platform does not support Column comments.');
}
public function testGetDefaultValueDeclarationSQL() : void
......@@ -1119,7 +1119,7 @@ abstract class AbstractPlatformTestCase extends TestCase
public function testQuotesDropForeignKeySQL() : void
{
if (! $this->platform->supportsForeignKeyConstraints()) {
$this->markTestSkipped(
self::markTestSkipped(
sprintf('%s does not support foreign key constraints.', get_class($this->platform))
);
}
......@@ -1226,7 +1226,7 @@ abstract class AbstractPlatformTestCase extends TestCase
public function testGeneratesInlineColumnCommentSQL(?string $comment, string $expectedSql) : void
{
if (! $this->platform->supportsInlineColumnComments()) {
$this->markTestSkipped(sprintf('%s does not support inline column comments.', get_class($this->platform)));
self::markTestSkipped(sprintf('%s does not support inline column comments.', get_class($this->platform)));
}
self::assertSame($expectedSql, $this->platform->getInlineColumnCommentSQL($comment));
......@@ -1291,7 +1291,7 @@ abstract class AbstractPlatformTestCase extends TestCase
public function testThrowsExceptionOnGeneratingInlineColumnCommentSQLIfUnsupported() : void
{
if ($this->platform->supportsInlineColumnComments()) {
$this->markTestSkipped(sprintf('%s supports inline column comments.', get_class($this->platform)));
self::markTestSkipped(sprintf('%s supports inline column comments.', get_class($this->platform)));
}
$this->expectException(DBALException::class);
......
......@@ -896,8 +896,8 @@ abstract class AbstractPostgreSQLPlatformTestCase extends AbstractPlatformTestCa
$tableDiff = $comparator->diffTable($table1, $table2);
$this->assertInstanceOf('Doctrine\DBAL\Schema\TableDiff', $tableDiff);
$this->assertSame(
self::assertInstanceOf('Doctrine\DBAL\Schema\TableDiff', $tableDiff);
self::assertSame(
[
'ALTER TABLE "foo" ALTER "bar" TYPE TIMESTAMP(0) WITHOUT TIME ZONE',
'ALTER TABLE "foo" ALTER "bar" DROP DEFAULT',
......
......@@ -1082,7 +1082,7 @@ abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCas
*/
protected function getQuotedAlterTableChangeColumnLengthSQL() : array
{
$this->markTestIncomplete('Not implemented yet');
self::markTestIncomplete('Not implemented yet');
}
/**
......
......@@ -502,7 +502,7 @@ class DB2PlatformTest extends AbstractPlatformTestCase
*/
protected function getQuotedAlterTableChangeColumnLengthSQL() : array
{
$this->markTestIncomplete('Not implemented yet');
self::markTestIncomplete('Not implemented yet');
}
/**
......
......@@ -45,6 +45,6 @@ class MariaDb1027PlatformTest extends AbstractMySQLPlatformTestCase
*/
public function testDoesNotPropagateDefaultValuesForUnsupportedColumnTypes() : void
{
$this->markTestSkipped('MariaDB102Platform support propagation of default values for BLOB and TEXT columns');
self::markTestSkipped('MariaDB102Platform support propagation of default values for BLOB and TEXT columns');
}
}
......@@ -632,7 +632,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
*/
protected function getQuotedAlterTableChangeColumnLengthSQL() : array
{
$this->markTestIncomplete('Not implemented yet');
self::markTestIncomplete('Not implemented yet');
}
/**
......
......@@ -1025,7 +1025,7 @@ class SQLAnywhere16PlatformTest extends AbstractPlatformTestCase
*/
protected function getQuotedAlterTableChangeColumnLengthSQL() : array
{
$this->markTestIncomplete('Not implemented yet');
self::markTestIncomplete('Not implemented yet');
}
/**
......
......@@ -595,7 +595,7 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
*/
public function testAlterTableRenameIndexInSchema() : void
{
$this->markTestIncomplete(
self::markTestIncomplete(
'Test currently produces broken SQL due to SQLLitePlatform::getAlterTable being broken ' .
'when used with schemas.'
);
......@@ -606,7 +606,7 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
*/
public function testQuotesAlterTableRenameIndexInSchema() : void
{
$this->markTestIncomplete(
self::markTestIncomplete(
'Test currently produces broken SQL due to SQLLitePlatform::getAlterTable being broken ' .
'when used with schemas.'
);
......
......@@ -43,10 +43,10 @@ class StatementTest extends TestCase
$type = ParameterType::STRING;
$length = 666;
$this->wrappedStmt->expects($this->once())
$this->wrappedStmt->expects(self::once())
->method('bindParam')
->with($column, $variable, $type, $length)
->will($this->returnValue(true));
->will(self::returnValue(true));
self::assertTrue($this->stmt->bindParam($column, $variable, $type, $length));
}
......@@ -57,19 +57,19 @@ class StatementTest extends TestCase
$value = 'myvalue';
$type = ParameterType::STRING;
$this->wrappedStmt->expects($this->once())
$this->wrappedStmt->expects(self::once())
->method('bindValue')
->with($param, $value, $type)
->will($this->returnValue(true));
->will(self::returnValue(true));
self::assertTrue($this->stmt->bindValue($param, $value, $type));
}
public function testCloseCursor() : void
{
$this->wrappedStmt->expects($this->once())
$this->wrappedStmt->expects(self::once())
->method('closeCursor')
->will($this->returnValue(true));
->will(self::returnValue(true));
self::assertTrue($this->stmt->closeCursor());
}
......@@ -78,9 +78,9 @@ class StatementTest extends TestCase
{
$columnCount = 666;
$this->wrappedStmt->expects($this->once())
$this->wrappedStmt->expects(self::once())
->method('columnCount')
->will($this->returnValue($columnCount));
->will(self::returnValue($columnCount));
self::assertSame($columnCount, $this->stmt->columnCount());
}
......@@ -89,9 +89,9 @@ class StatementTest extends TestCase
{
$errorCode = '666';
$this->wrappedStmt->expects($this->once())
$this->wrappedStmt->expects(self::once())
->method('errorCode')
->will($this->returnValue($errorCode));
->will(self::returnValue($errorCode));
self::assertSame($errorCode, $this->stmt->errorCode());
}
......@@ -100,9 +100,9 @@ class StatementTest extends TestCase
{
$errorInfo = ['666', 'Evil error.'];
$this->wrappedStmt->expects($this->once())
$this->wrappedStmt->expects(self::once())
->method('errorInfo')
->will($this->returnValue($errorInfo));
->will(self::returnValue($errorInfo));
self::assertSame($errorInfo, $this->stmt->errorInfo());
}
......@@ -114,10 +114,10 @@ class StatementTest extends TestCase
'bar',
];
$this->wrappedStmt->expects($this->once())
$this->wrappedStmt->expects(self::once())
->method('execute')
->with($params)
->will($this->returnValue(true));
->will(self::returnValue(true));
self::assertTrue($this->stmt->execute($params));
}
......@@ -128,10 +128,10 @@ class StatementTest extends TestCase
$arg1 = 'MyClass';
$arg2 = [1, 2];
$this->wrappedStmt->expects($this->once())
$this->wrappedStmt->expects(self::once())
->method('setFetchMode')
->with($fetchMode, $arg1, $arg2)
->will($this->returnValue(true));
->will(self::returnValue(true));
$re = new ReflectionProperty($this->stmt, 'defaultFetchMode');
$re->setAccessible(true);
......@@ -143,7 +143,7 @@ class StatementTest extends TestCase
public function testGetIterator() : void
{
$this->wrappedStmt->expects($this->exactly(3))
$this->wrappedStmt->expects(self::exactly(3))
->method('fetch')
->willReturnOnConsecutiveCalls('foo', 'bar', false);
......@@ -154,9 +154,9 @@ class StatementTest extends TestCase
{
$rowCount = 666;
$this->wrappedStmt->expects($this->once())
$this->wrappedStmt->expects(self::once())
->method('rowCount')
->will($this->returnValue($rowCount));
->will(self::returnValue($rowCount));
self::assertSame($rowCount, $this->stmt->rowCount());
}
......
......@@ -21,9 +21,9 @@ class ExpressionBuilderTest extends TestCase
$this->expr = new ExpressionBuilder($conn);
$conn->expects($this->any())
$conn->expects(self::any())
->method('getExpressionBuilder')
->will($this->returnValue($this->expr));
->will(self::returnValue($this->expr));
}
/**
......
......@@ -23,9 +23,9 @@ class QueryBuilderTest extends TestCase
$expressionBuilder = new ExpressionBuilder($this->conn);
$this->conn->expects($this->any())
$this->conn->expects(self::any())
->method('getExpressionBuilder')
->will($this->returnValue($expressionBuilder));
->will(self::returnValue($expressionBuilder));
}
/**
......
......@@ -1178,33 +1178,33 @@ class ComparatorTest extends TestCase
->onlyMethods(['getNamespaces', 'hasNamespace'])
->getMock();
$fromSchema->expects($this->once())
$fromSchema->expects(self::once())
->method('getNamespaces')
->will($this->returnValue(['foo', 'bar']));
->will(self::returnValue(['foo', 'bar']));
$fromSchema->expects($this->at(0))
$fromSchema->expects(self::at(0))
->method('hasNamespace')
->with('bar')
->will($this->returnValue(true));
->will(self::returnValue(true));
$fromSchema->expects($this->at(1))
$fromSchema->expects(self::at(1))
->method('hasNamespace')
->with('baz')
->will($this->returnValue(false));
->will(self::returnValue(false));
$toSchema->expects($this->once())
$toSchema->expects(self::once())
->method('getNamespaces')
->will($this->returnValue(['bar', 'baz']));
->will(self::returnValue(['bar', 'baz']));
$toSchema->expects($this->at(1))
$toSchema->expects(self::at(1))
->method('hasNamespace')
->with('foo')
->will($this->returnValue(false));
->will(self::returnValue(false));
$toSchema->expects($this->at(2))
$toSchema->expects(self::at(2))
->method('hasNamespace')
->with('bar')
->will($this->returnValue(true));
->will(self::returnValue(true));
$expected = new SchemaDiff();
$expected->fromSchema = $fromSchema;
......
......@@ -44,7 +44,7 @@ final class DB2SchemaManagerTest extends TestCase
public function testListTableNamesFiltersAssetNamesCorrectly() : void
{
$this->conn->getConfiguration()->setFilterSchemaAssetsExpression('/^(?!T_)/');
$this->conn->expects($this->once())->method('fetchAll')->will($this->returnValue([
$this->conn->expects(self::once())->method('fetchAll')->will(self::returnValue([
['name' => 'FOO'],
['name' => 'T_FOO'],
['name' => 'BAR'],
......@@ -67,7 +67,7 @@ final class DB2SchemaManagerTest extends TestCase
{
$filterExpression = '/^(?!T_)/';
$this->conn->getConfiguration()->setFilterSchemaAssetsExpression($filterExpression);
$this->conn->expects($this->once())->method('fetchAll')->will($this->returnValue([
$this->conn->expects(self::once())->method('fetchAll')->will(self::returnValue([
['name' => 'FOO'],
['name' => 'T_FOO'],
['name' => 'BAR'],
......@@ -86,7 +86,7 @@ final class DB2SchemaManagerTest extends TestCase
self::assertIsCallable($callable);
// BC check: Test that regexp expression is still preserved & accessible.
$this->assertEquals($filterExpression, $this->conn->getConfiguration()->getFilterSchemaAssetsExpression());
self::assertEquals($filterExpression, $this->conn->getConfiguration()->getFilterSchemaAssetsExpression());
}
public function testListTableNamesFiltersAssetNamesCorrectlyWithCallable() : void
......@@ -95,8 +95,8 @@ final class DB2SchemaManagerTest extends TestCase
$this->conn->getConfiguration()->setSchemaAssetsFilter(static function ($assetName) use ($accepted) {
return in_array($assetName, $accepted);
});
$this->conn->expects($this->any())->method('quote');
$this->conn->expects($this->once())->method('fetchAll')->will($this->returnValue([
$this->conn->expects(self::any())->method('quote');
$this->conn->expects(self::once())->method('fetchAll')->will(self::returnValue([
['name' => 'FOO'],
['name' => 'T_FOO'],
['name' => 'BAR'],
......@@ -111,7 +111,7 @@ final class DB2SchemaManagerTest extends TestCase
$this->manager->listTableNames()
);
$this->assertNull($this->conn->getConfiguration()->getFilterSchemaAssetsExpression());
self::assertNull($this->conn->getConfiguration()->getFilterSchemaAssetsExpression());
}
public function testSettingNullExpressionWillResetCallable() : void
......@@ -120,8 +120,8 @@ final class DB2SchemaManagerTest extends TestCase
$this->conn->getConfiguration()->setSchemaAssetsFilter(static function ($assetName) use ($accepted) {
return in_array($assetName, $accepted);
});
$this->conn->expects($this->any())->method('quote');
$this->conn->expects($this->atLeastOnce())->method('fetchAll')->will($this->returnValue([
$this->conn->expects(self::any())->method('quote');
$this->conn->expects($this->atLeastOnce())->method('fetchAll')->will(self::returnValue([
['name' => 'FOO'],
['name' => 'T_FOO'],
['name' => 'BAR'],
......@@ -148,7 +148,7 @@ final class DB2SchemaManagerTest extends TestCase
$this->manager->listTableNames()
);
$this->assertNull($this->conn->getConfiguration()->getSchemaAssetsFilter());
self::assertNull($this->conn->getConfiguration()->getSchemaAssetsFilter());
}
public function testSettingNullAsCallableClearsExpression() : void
......@@ -156,7 +156,7 @@ final class DB2SchemaManagerTest extends TestCase
$filterExpression = '/^(?!T_)/';
$this->conn->getConfiguration()->setFilterSchemaAssetsExpression($filterExpression);
$this->conn->expects($this->exactly(2))->method('fetchAll')->will($this->returnValue([
$this->conn->expects(self::exactly(2))->method('fetchAll')->will(self::returnValue([
['name' => 'FOO'],
['name' => 'T_FOO'],
['name' => 'BAR'],
......
......@@ -22,9 +22,9 @@ class ForeignKeyConstraintTest extends TestCase
$index = $this->getMockBuilder(Index::class)
->disableOriginalConstructor()
->getMock();
$index->expects($this->once())
$index->expects(self::once())
->method('getColumns')
->will($this->returnValue($indexColumns));
->will(self::returnValue($indexColumns));
self::assertSame($expectedResult, $foreignKey->intersectsIndexColumns($index));
}
......
......@@ -35,7 +35,7 @@ class MySqlSchemaManagerTest extends TestCase
public function testCompositeForeignKeys() : void
{
$this->conn->expects($this->once())->method('fetchAll')->will($this->returnValue($this->getFKDefinition()));
$this->conn->expects(self::once())->method('fetchAll')->will(self::returnValue($this->getFKDefinition()));
$fkeys = $this->manager->listTableForeignKeys('dummy');
self::assertCount(1, $fkeys, 'Table has to have one foreign key.');
......
......@@ -44,60 +44,60 @@ class SchemaDiffTest extends TestCase
{
/** @var AbstractPlatform|MockObject $platform */
$platform = $this->createMock(AbstractPlatform::class);
$platform->expects($this->exactly(1))
$platform->expects(self::exactly(1))
->method('getCreateSchemaSQL')
->with('foo_ns')
->will($this->returnValue('create_schema'));
->will(self::returnValue('create_schema'));
if ($unsafe) {
$platform->expects($this->exactly(1))
$platform->expects(self::exactly(1))
->method('getDropSequenceSql')
->with($this->isInstanceOf(Sequence::class))
->will($this->returnValue('drop_seq'));
->with(self::isInstanceOf(Sequence::class))
->will(self::returnValue('drop_seq'));
}
$platform->expects($this->exactly(1))
$platform->expects(self::exactly(1))
->method('getAlterSequenceSql')
->with($this->isInstanceOf(Sequence::class))
->will($this->returnValue('alter_seq'));
$platform->expects($this->exactly(1))
->with(self::isInstanceOf(Sequence::class))
->will(self::returnValue('alter_seq'));
$platform->expects(self::exactly(1))
->method('getCreateSequenceSql')
->with($this->isInstanceOf(Sequence::class))
->will($this->returnValue('create_seq'));
->with(self::isInstanceOf(Sequence::class))
->will(self::returnValue('create_seq'));
if ($unsafe) {
$platform->expects($this->exactly(1))
$platform->expects(self::exactly(1))
->method('getDropTableSql')
->with($this->isInstanceOf(Table::class))
->will($this->returnValue('drop_table'));
->with(self::isInstanceOf(Table::class))
->will(self::returnValue('drop_table'));
}
$platform->expects($this->exactly(1))
$platform->expects(self::exactly(1))
->method('getCreateTableSql')
->with($this->isInstanceOf(Table::class))
->will($this->returnValue(['create_table']));
$platform->expects($this->exactly(1))
->with(self::isInstanceOf(Table::class))
->will(self::returnValue(['create_table']));
$platform->expects(self::exactly(1))
->method('getCreateForeignKeySQL')
->with($this->isInstanceOf(ForeignKeyConstraint::class))
->will($this->returnValue('create_foreign_key'));
$platform->expects($this->exactly(1))
->with(self::isInstanceOf(ForeignKeyConstraint::class))
->will(self::returnValue('create_foreign_key'));
$platform->expects(self::exactly(1))
->method('getAlterTableSql')
->with($this->isInstanceOf(TableDiff::class))
->will($this->returnValue(['alter_table']));
->with(self::isInstanceOf(TableDiff::class))
->will(self::returnValue(['alter_table']));
if ($unsafe) {
$platform->expects($this->exactly(1))
$platform->expects(self::exactly(1))
->method('getDropForeignKeySql')
->with(
$this->isInstanceOf(ForeignKeyConstraint::class),
$this->isInstanceOf(Table::class)
self::isInstanceOf(ForeignKeyConstraint::class),
self::isInstanceOf(Table::class)
)
->will($this->returnValue('drop_orphan_fk'));
->will(self::returnValue('drop_orphan_fk'));
}
$platform->expects($this->exactly(1))
$platform->expects(self::exactly(1))
->method('supportsSchemas')
->will($this->returnValue(true));
$platform->expects($this->exactly(1))
->will(self::returnValue(true));
$platform->expects(self::exactly(1))
->method('supportsSequences')
->will($this->returnValue(true));
$platform->expects($this->exactly(2))
->will(self::returnValue(true));
$platform->expects(self::exactly(2))
->method('supportsForeignKeyConstraints')
->will($this->returnValue(true));
->will(self::returnValue(true));
return $platform;
}
......
......@@ -373,30 +373,30 @@ class SchemaTest extends TestCase
$schema->createSequence('moo');
$schema->createSequence('war');
$visitor->expects($this->once())
$visitor->expects(self::once())
->method('acceptSchema')
->with($schema);
$visitor->expects($this->at(1))
$visitor->expects(self::at(1))
->method('acceptTable')
->with($schema->getTable('baz'));
$visitor->expects($this->at(2))
$visitor->expects(self::at(2))
->method('acceptTable')
->with($schema->getTable('bla.bloo'));
$visitor->expects($this->exactly(2))
$visitor->expects(self::exactly(2))
->method('acceptTable');
$visitor->expects($this->at(3))
$visitor->expects(self::at(3))
->method('acceptSequence')
->with($schema->getSequence('moo'));
$visitor->expects($this->at(4))
$visitor->expects(self::at(4))
->method('acceptSequence')
->with($schema->getSequence('war'));
$visitor->expects($this->exactly(2))
$visitor->expects(self::exactly(2))
->method('acceptSequence');
self::assertNull($schema->visit($visitor));
......@@ -419,45 +419,45 @@ class SchemaTest extends TestCase
$schema->createSequence('moo');
$schema->createSequence('war');
$visitor->expects($this->once())
$visitor->expects(self::once())
->method('acceptSchema')
->with($schema);
$visitor->expects($this->at(1))
$visitor->expects(self::at(1))
->method('acceptNamespace')
->with('foo');
$visitor->expects($this->at(2))
$visitor->expects(self::at(2))
->method('acceptNamespace')
->with('bar');
$visitor->expects($this->at(3))
$visitor->expects(self::at(3))
->method('acceptNamespace')
->with('bla');
$visitor->expects($this->exactly(3))
$visitor->expects(self::exactly(3))
->method('acceptNamespace');
$visitor->expects($this->at(4))
$visitor->expects(self::at(4))
->method('acceptTable')
->with($schema->getTable('baz'));
$visitor->expects($this->at(5))
$visitor->expects(self::at(5))
->method('acceptTable')
->with($schema->getTable('bla.bloo'));
$visitor->expects($this->exactly(2))
$visitor->expects(self::exactly(2))
->method('acceptTable');
$visitor->expects($this->at(6))
$visitor->expects(self::at(6))
->method('acceptSequence')
->with($schema->getSequence('moo'));
$visitor->expects($this->at(7))
$visitor->expects(self::at(7))
->method('acceptSequence')
->with($schema->getSequence('war'));
$visitor->expects($this->exactly(2))
$visitor->expects(self::exactly(2))
->method('acceptSequence');
self::assertNull($schema->visit($visitor));
......
......@@ -41,10 +41,10 @@ class TableDiffTest extends TestCase
$tableDiff = new TableDiff('foo');
$tableDiff->fromTable = $tableMock;
$tableMock->expects($this->once())
$tableMock->expects(self::once())
->method('getQuotedName')
->with($this->platform)
->will($this->returnValue('foo'));
->will(self::returnValue('foo'));
self::assertEquals(new Identifier('foo'), $tableDiff->getName($this->platform));
}
......
......@@ -50,13 +50,13 @@ class CreateSchemaSqlCollectorTest extends TestCase
public function testAcceptsNamespace() : void
{
$this->platformMock->expects($this->at(0))
$this->platformMock->expects(self::at(0))
->method('supportsSchemas')
->will($this->returnValue(false));
->will(self::returnValue(false));
$this->platformMock->expects($this->at(1))
$this->platformMock->expects(self::at(1))
->method('supportsSchemas')
->will($this->returnValue(true));
->will(self::returnValue(true));
$this->visitor->acceptNamespace('foo');
......@@ -78,13 +78,13 @@ class CreateSchemaSqlCollectorTest extends TestCase
public function testAcceptsForeignKey() : void
{
$this->platformMock->expects($this->at(0))
$this->platformMock->expects(self::at(0))
->method('supportsForeignKeyConstraints')
->will($this->returnValue(false));
->will(self::returnValue(false));
$this->platformMock->expects($this->at(1))
$this->platformMock->expects(self::at(1))
->method('supportsForeignKeyConstraints')
->will($this->returnValue(true));
->will(self::returnValue(true));
$table = $this->createTableMock();
$foreignKey = $this->createForeignKeyConstraintMock();
......@@ -110,9 +110,9 @@ class CreateSchemaSqlCollectorTest extends TestCase
public function testResetsQueries() : void
{
foreach (['supportsSchemas', 'supportsForeignKeyConstraints'] as $method) {
$this->platformMock->expects($this->any())
$this->platformMock->expects(self::any())
->method($method)
->will($this->returnValue(true));
->will(self::returnValue(true));
}
$table = $this->createTableMock();
......
......@@ -28,14 +28,14 @@ class DropSchemaSqlCollectorTest extends TestCase
$collector = new DropSchemaSqlCollector($platform);
$platform->expects($this->exactly(2))
$platform->expects(self::exactly(2))
->method('getDropForeignKeySQL');
$platform->expects($this->at(0))
$platform->expects(self::at(0))
->method('getDropForeignKeySQL')
->with($keyConstraintOne, $tableOne);
$platform->expects($this->at(1))
$platform->expects(self::at(1))
->method('getDropForeignKeySQL')
->with($keyConstraintTwo, $tableTwo);
......@@ -49,17 +49,17 @@ class DropSchemaSqlCollectorTest extends TestCase
{
$constraint = $this->createMock(ForeignKeyConstraint::class);
$constraint->expects($this->any())
$constraint->expects(self::any())
->method('getName')
->will($this->returnValue($name));
->will(self::returnValue($name));
$constraint->expects($this->any())
$constraint->expects(self::any())
->method('getForeignColumns')
->will($this->returnValue([]));
->will(self::returnValue([]));
$constraint->expects($this->any())
$constraint->expects(self::any())
->method('getColumns')
->will($this->returnValue([]));
->will(self::returnValue([]));
return $constraint;
}
......
......@@ -13,15 +13,15 @@ class SchemaSqlCollectorTest extends TestCase
$platformMock = $this->getMockBuilder(MySqlPlatform::class)
->onlyMethods(['getCreateTableSql', 'getCreateSequenceSql', 'getCreateForeignKeySql'])
->getMock();
$platformMock->expects($this->exactly(2))
$platformMock->expects(self::exactly(2))
->method('getCreateTableSql')
->will($this->returnValue(['foo']));
$platformMock->expects($this->exactly(1))
->will(self::returnValue(['foo']));
$platformMock->expects(self::exactly(1))
->method('getCreateSequenceSql')
->will($this->returnValue('bar'));
$platformMock->expects($this->exactly(1))
->will(self::returnValue('bar'));
$platformMock->expects(self::exactly(1))
->method('getCreateForeignKeySql')
->will($this->returnValue('baz'));
->will(self::returnValue('baz'));
$schema = $this->createFixtureSchema();
......@@ -35,15 +35,15 @@ class SchemaSqlCollectorTest extends TestCase
$platformMock = $this->getMockBuilder(MySqlPlatform::class)
->onlyMethods(['getDropTableSql', 'getDropSequenceSql', 'getDropForeignKeySql'])
->getMock();
$platformMock->expects($this->exactly(2))
$platformMock->expects(self::exactly(2))
->method('getDropTableSql')
->will($this->returnValue('tbl'));
$platformMock->expects($this->exactly(1))
->will(self::returnValue('tbl'));
$platformMock->expects(self::exactly(1))
->method('getDropSequenceSql')
->will($this->returnValue('seq'));
$platformMock->expects($this->exactly(1))
->will(self::returnValue('seq'));
$platformMock->expects(self::exactly(1))
->method('getDropForeignKeySql')
->will($this->returnValue('fk'));
->will(self::returnValue('fk'));
$schema = $this->createFixtureSchema();
......
......@@ -40,18 +40,18 @@ class StatementTest extends TestCase
$this->conn = $this->getMockBuilder(Connection::class)
->setConstructorArgs([[], $driver])
->getMock();
$this->conn->expects($this->atLeastOnce())
$this->conn->expects(self::atLeastOnce())
->method('getWrappedConnection')
->will($this->returnValue($driverConnection));
->will(self::returnValue($driverConnection));
$this->configuration = $this->createMock(Configuration::class);
$this->conn->expects($this->any())
$this->conn->expects(self::any())
->method('getConfiguration')
->will($this->returnValue($this->configuration));
->will(self::returnValue($this->configuration));
$this->conn->expects($this->any())
$this->conn->expects(self::any())
->method('getDriver')
->will($this->returnValue($driver));
->will(self::returnValue($driver));
}
public function testExecuteCallsLoggerStartQueryWithParametersWhenValuesBound() : void
......@@ -64,13 +64,13 @@ class StatementTest extends TestCase
$sql = '';
$logger = $this->createMock(SQLLogger::class);
$logger->expects($this->once())
$logger->expects(self::once())
->method('startQuery')
->with($this->equalTo($sql), $this->equalTo($values), $this->equalTo($types));
->with(self::equalTo($sql), self::equalTo($values), self::equalTo($types));
$this->configuration->expects($this->once())
$this->configuration->expects(self::once())
->method('getSQLLogger')
->will($this->returnValue($logger));
->will(self::returnValue($logger));
$statement = new Statement($sql, $this->conn);
$statement->bindValue($name, $var, $type);
......@@ -86,13 +86,13 @@ class StatementTest extends TestCase
$sql = '';
$logger = $this->createMock(SQLLogger::class);
$logger->expects($this->once())
$logger->expects(self::once())
->method('startQuery')
->with($this->equalTo($sql), $this->equalTo($values), $this->equalTo($types));
->with(self::equalTo($sql), self::equalTo($values), self::equalTo($types));
$this->configuration->expects($this->once())
$this->configuration->expects(self::once())
->method('getSQLLogger')
->will($this->returnValue($logger));
->will(self::returnValue($logger));
$statement = new Statement($sql, $this->conn);
$statement->execute($values);
......@@ -124,24 +124,24 @@ class StatementTest extends TestCase
{
$logger = $this->createMock(SQLLogger::class);
$this->configuration->expects($this->once())
$this->configuration->expects(self::once())
->method('getSQLLogger')
->will($this->returnValue($logger));
->will(self::returnValue($logger));
// Needed to satisfy construction of DBALException
$this->conn->expects($this->any())
$this->conn->expects(self::any())
->method('resolveParams')
->will($this->returnValue([]));
->will(self::returnValue([]));
$logger->expects($this->once())
$logger->expects(self::once())
->method('startQuery');
$logger->expects($this->once())
$logger->expects(self::once())
->method('stopQuery');
$this->driverStatement->expects($this->once())
$this->driverStatement->expects(self::once())
->method('execute')
->will($this->throwException(new Exception('Mock test exception')));
->will(self::throwException(new Exception('Mock test exception')));
$statement = new Statement('', $this->conn);
......@@ -154,7 +154,7 @@ class StatementTest extends TestCase
{
$statement = new Statement('', $this->conn);
$this->driverStatement->expects($this->once())
$this->driverStatement->expects(self::once())
->method('fetchAll')
->with(self::equalTo(FetchMode::CUSTOM_OBJECT), self::equalTo('Example'), self::equalTo(['arg1']));
......
......@@ -46,7 +46,7 @@ class RunSqlCommandTest extends TestCase
'command' => $this->command->getName(),
'sql' => null,
]);
$this->fail('Expected a runtime exception when omitting sql argument');
self::fail('Expected a runtime exception when omitting sql argument');
} catch (RuntimeException $e) {
self::assertStringContainsString("Argument 'SQL", $e->getMessage());
}
......@@ -60,7 +60,7 @@ class RunSqlCommandTest extends TestCase
'sql' => 'SELECT 1',
'--depth' => 'string',
]);
$this->fail('Expected a logic exception when executing with a stringy depth');
self::fail('Expected a logic exception when executing with a stringy depth');
} catch (LogicException $e) {
self::assertStringContainsString("Option 'depth'", $e->getMessage());
}
......@@ -74,7 +74,7 @@ class RunSqlCommandTest extends TestCase
'command' => $this->command->getName(),
'sql' => 'SELECT 1',
]);
$this->assertSame(0, $exitCode);
self::assertSame(0, $exitCode);
self::assertRegExp('@int.*1.*@', $this->commandTester->getDisplay());
self::assertRegExp('@array.*1.*@', $this->commandTester->getDisplay());
......@@ -96,20 +96,20 @@ class RunSqlCommandTest extends TestCase
private function expectConnectionExecuteUpdate() : void
{
$this->connectionMock
->expects($this->exactly(1))
->expects(self::exactly(1))
->method('executeUpdate');
$this->connectionMock
->expects($this->exactly(0))
->expects(self::exactly(0))
->method('fetchAll');
}
private function expectConnectionFetchAll() : void
{
$this->connectionMock
->expects($this->exactly(0))
->expects(self::exactly(0))
->method('executeUpdate');
$this->connectionMock
->expects($this->exactly(1))
->expects(self::exactly(1))
->method('fetchAll');
}
......
......@@ -43,7 +43,7 @@ class BinaryTest extends TestCase
public function testReturnsSQLDeclaration() : void
{
$this->platform->expects($this->once())
$this->platform->expects(self::once())
->method('getBinaryTypeDeclarationSQL')
->willReturn('TEST_BINARY');
......
......@@ -46,10 +46,10 @@ class DateImmutableTypeTest extends TestCase
{
$date = $this->createMock(DateTimeImmutable::class);
$this->platform->expects($this->once())
$this->platform->expects(self::once())
->method('getDateFormatString')
->willReturn('Y-m-d');
$date->expects($this->once())
$date->expects(self::once())
->method('format')
->with('Y-m-d')
->willReturn('2016-01-01');
......@@ -86,7 +86,7 @@ class DateImmutableTypeTest extends TestCase
public function testConvertsDateStringToPHPValue() : void
{
$this->platform->expects($this->once())
$this->platform->expects(self::once())
->method('getDateFormatString')
->willReturn('Y-m-d');
......@@ -98,7 +98,7 @@ class DateImmutableTypeTest extends TestCase
public function testResetTimeFractionsWhenConvertingToPHPValue() : void
{
$this->platform->expects($this->any())
$this->platform->expects(self::any())
->method('getDateFormatString')
->willReturn('Y-m-d');
......
......@@ -46,10 +46,10 @@ class DateTimeImmutableTypeTest extends TestCase
{
$date = $this->getMockBuilder(DateTimeImmutable::class)->getMock();
$this->platform->expects($this->once())
$this->platform->expects(self::once())
->method('getDateTimeFormatString')
->willReturn('Y-m-d H:i:s');
$date->expects($this->once())
$date->expects(self::once())
->method('format')
->with('Y-m-d H:i:s')
->willReturn('2016-01-01 15:58:59');
......@@ -86,7 +86,7 @@ class DateTimeImmutableTypeTest extends TestCase
public function testConvertsDateTimeStringToPHPValue() : void
{
$this->platform->expects($this->once())
$this->platform->expects(self::once())
->method('getDateTimeFormatString')
->willReturn('Y-m-d H:i:s');
......@@ -101,7 +101,7 @@ class DateTimeImmutableTypeTest extends TestCase
*/
public function testConvertsDateTimeStringWithMicrosecondsToPHPValue() : void
{
$this->platform->expects($this->any())
$this->platform->expects(self::any())
->method('getDateTimeFormatString')
->willReturn('Y-m-d H:i:s');
......@@ -112,7 +112,7 @@ class DateTimeImmutableTypeTest extends TestCase
public function testThrowsExceptionDuringConversionToPHPValueWithInvalidDateTimeString() : void
{
$this->platform->expects($this->atLeastOnce())
$this->platform->expects(self::atLeastOnce())
->method('getDateTimeFormatString')
->willReturn('Y-m-d H:i:s');
......
......@@ -46,10 +46,10 @@ class DateTimeTzImmutableTypeTest extends TestCase
{
$date = $this->createMock(DateTimeImmutable::class);
$this->platform->expects($this->once())
$this->platform->expects(self::once())
->method('getDateTimeTzFormatString')
->willReturn('Y-m-d H:i:s T');
$date->expects($this->once())
$date->expects(self::once())
->method('format')
->with('Y-m-d H:i:s T')
->willReturn('2016-01-01 15:58:59 UTC');
......@@ -86,7 +86,7 @@ class DateTimeTzImmutableTypeTest extends TestCase
public function testConvertsDateTimeWithTimezoneStringToPHPValue() : void
{
$this->platform->expects($this->once())
$this->platform->expects(self::once())
->method('getDateTimeTzFormatString')
->willReturn('Y-m-d H:i:s T');
......@@ -98,7 +98,7 @@ class DateTimeTzImmutableTypeTest extends TestCase
public function testThrowsExceptionDuringConversionToPHPValueWithInvalidDateTimeWithTimezoneString() : void
{
$this->platform->expects($this->atLeastOnce())
$this->platform->expects(self::atLeastOnce())
->method('getDateTimeTzFormatString')
->willReturn('Y-m-d H:i:s T');
......
......@@ -37,9 +37,9 @@ class GuidTypeTest extends TestCase
{
self::assertTrue($this->type->requiresSQLCommentHint($this->platform));
$this->platform->expects($this->any())
$this->platform->expects(self::any())
->method('hasNativeGuidType')
->will($this->returnValue(true));
->will(self::returnValue(true));
self::assertFalse($this->type->requiresSQLCommentHint($this->platform));
}
......
......@@ -42,7 +42,7 @@ class JsonArrayTest extends TestCase
public function testReturnsSQLDeclaration() : void
{
$this->platform->expects($this->once())
$this->platform->expects(self::once())
->method('getJsonTypeDeclarationSQL')
->willReturn('TEST_JSON');
......
......@@ -43,7 +43,7 @@ class JsonTest extends TestCase
public function testReturnsSQLDeclaration() : void
{
$this->platform->expects($this->once())
$this->platform->expects(self::once())
->method('getJsonTypeDeclarationSQL')
->willReturn('TEST_JSON');
......
......@@ -24,7 +24,7 @@ class StringTest extends TestCase
public function testReturnsSqlDeclarationFromPlatformVarchar() : void
{
$this->platform->expects($this->once())
$this->platform->expects(self::once())
->method('getVarcharTypeDeclarationSQL')
->willReturn('TEST_VARCHAR');
......@@ -33,7 +33,7 @@ class StringTest extends TestCase
public function testReturnsDefaultLengthFromPlatformVarchar() : void
{
$this->platform->expects($this->once())
$this->platform->expects(self::once())
->method('getVarcharDefaultLength')
->willReturn(255);
......
......@@ -46,10 +46,10 @@ class TimeImmutableTypeTest extends TestCase
{
$date = $this->getMockBuilder(DateTimeImmutable::class)->getMock();
$this->platform->expects($this->once())
$this->platform->expects(self::once())
->method('getTimeFormatString')
->willReturn('H:i:s');
$date->expects($this->once())
$date->expects(self::once())
->method('format')
->with('H:i:s')
->willReturn('15:58:59');
......@@ -86,7 +86,7 @@ class TimeImmutableTypeTest extends TestCase
public function testConvertsTimeStringToPHPValue() : void
{
$this->platform->expects($this->once())
$this->platform->expects(self::once())
->method('getTimeFormatString')
->willReturn('H:i:s');
......@@ -98,7 +98,7 @@ class TimeImmutableTypeTest extends TestCase
public function testResetDateFractionsWhenConvertingToPHPValue() : void
{
$this->platform->expects($this->any())
$this->platform->expects(self::any())
->method('getTimeFormatString')
->willReturn('H:i:s');
......
......@@ -44,7 +44,7 @@ class VarDateTimeImmutableTypeTest extends TestCase
{
$date = $this->getMockBuilder(DateTimeImmutable::class)->getMock();
$date->expects($this->once())
$date->expects(self::once())
->method('format')
->with('Y-m-d H:i:s')
->willReturn('2016-01-01 15:58:59');
......
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