Use `self::assert*()` instead of `$this->assert*()`

parent 48fa3958
...@@ -40,7 +40,7 @@ class QueryCacheProfileTest extends DbalTestCase ...@@ -40,7 +40,7 @@ class QueryCacheProfileTest extends DbalTestCase
$connectionParams $connectionParams
); );
$this->assertEquals(self::CACHE_KEY, $cacheKey, 'The returned cache key should match the given one'); self::assertEquals(self::CACHE_KEY, $cacheKey, 'The returned cache key should match the given one');
} }
public function testShouldGenerateAnAutomaticKeyIfNoKeyHasBeenGiven() public function testShouldGenerateAnAutomaticKeyIfNoKeyHasBeenGiven()
...@@ -66,13 +66,13 @@ class QueryCacheProfileTest extends DbalTestCase ...@@ -66,13 +66,13 @@ class QueryCacheProfileTest extends DbalTestCase
$connectionParams $connectionParams
); );
$this->assertNotEquals( self::assertNotEquals(
self::CACHE_KEY, self::CACHE_KEY,
$cacheKey, $cacheKey,
'The returned cache key should be generated automatically' 'The returned cache key should be generated automatically'
); );
$this->assertNotEmpty($cacheKey, 'The generated cache key should not be empty'); self::assertNotEmpty($cacheKey, 'The generated cache key should not be empty');
} }
public function testShouldGenerateDifferentKeysForSameQueryAndParamsAndDifferentConnections() public function testShouldGenerateDifferentKeysForSameQueryAndParamsAndDifferentConnections()
...@@ -107,7 +107,7 @@ class QueryCacheProfileTest extends DbalTestCase ...@@ -107,7 +107,7 @@ class QueryCacheProfileTest extends DbalTestCase
$connectionParams $connectionParams
); );
$this->assertNotEquals($firstCacheKey, $secondCacheKey, 'Cache keys should be different'); self::assertNotEquals($firstCacheKey, $secondCacheKey, 'Cache keys should be different');
} }
public function testShouldGenerateSameKeysIfNoneOfTheParamsChanges() public function testShouldGenerateSameKeysIfNoneOfTheParamsChanges()
...@@ -140,6 +140,6 @@ class QueryCacheProfileTest extends DbalTestCase ...@@ -140,6 +140,6 @@ class QueryCacheProfileTest extends DbalTestCase
$connectionParams $connectionParams
); );
$this->assertEquals($firstCacheKey, $secondCacheKey, 'Cache keys should be the same'); self::assertEquals($firstCacheKey, $secondCacheKey, 'Cache keys should be the same');
} }
} }
...@@ -51,7 +51,7 @@ class ConfigurationTest extends DbalTestCase ...@@ -51,7 +51,7 @@ class ConfigurationTest extends DbalTestCase
*/ */
public function testReturnsDefaultConnectionAutoCommitMode() public function testReturnsDefaultConnectionAutoCommitMode()
{ {
$this->assertTrue($this->config->getAutoCommit()); self::assertTrue($this->config->getAutoCommit());
} }
/** /**
...@@ -63,10 +63,10 @@ class ConfigurationTest extends DbalTestCase ...@@ -63,10 +63,10 @@ class ConfigurationTest extends DbalTestCase
{ {
$this->config->setAutoCommit(false); $this->config->setAutoCommit(false);
$this->assertFalse($this->config->getAutoCommit()); self::assertFalse($this->config->getAutoCommit());
$this->config->setAutoCommit(0); $this->config->setAutoCommit(0);
$this->assertFalse($this->config->getAutoCommit()); self::assertFalse($this->config->getAutoCommit());
} }
} }
...@@ -56,12 +56,12 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -56,12 +56,12 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
public function testIsConnected() public function testIsConnected()
{ {
$this->assertFalse($this->_conn->isConnected()); self::assertFalse($this->_conn->isConnected());
} }
public function testNoTransactionActiveByDefault() public function testNoTransactionActiveByDefault()
{ {
$this->assertFalse($this->_conn->isTransactionActive()); self::assertFalse($this->_conn->isTransactionActive());
} }
public function testCommitWithNoActiveTransaction_ThrowsException() public function testCommitWithNoActiveTransaction_ThrowsException()
...@@ -92,37 +92,37 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -92,37 +92,37 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
{ {
$config = $this->_conn->getConfiguration(); $config = $this->_conn->getConfiguration();
$this->assertInstanceOf('Doctrine\DBAL\Configuration', $config); self::assertInstanceOf('Doctrine\DBAL\Configuration', $config);
} }
public function testGetHost() public function testGetHost()
{ {
$this->assertEquals('localhost', $this->_conn->getHost()); self::assertEquals('localhost', $this->_conn->getHost());
} }
public function testGetPort() public function testGetPort()
{ {
$this->assertEquals('1234', $this->_conn->getPort()); self::assertEquals('1234', $this->_conn->getPort());
} }
public function testGetUsername() public function testGetUsername()
{ {
$this->assertEquals('root', $this->_conn->getUsername()); self::assertEquals('root', $this->_conn->getUsername());
} }
public function testGetPassword() public function testGetPassword()
{ {
$this->assertEquals('password', $this->_conn->getPassword()); self::assertEquals('password', $this->_conn->getPassword());
} }
public function testGetDriver() public function testGetDriver()
{ {
$this->assertInstanceOf('Doctrine\DBAL\Driver\PDOMySql\Driver', $this->_conn->getDriver()); self::assertInstanceOf('Doctrine\DBAL\Driver\PDOMySql\Driver', $this->_conn->getDriver());
} }
public function testGetEventManager() public function testGetEventManager()
{ {
$this->assertInstanceOf('Doctrine\Common\EventManager', $this->_conn->getEventManager()); self::assertInstanceOf('Doctrine\Common\EventManager', $this->_conn->getEventManager());
} }
public function testConnectDispatchEvent() public function testConnectDispatchEvent()
...@@ -148,8 +148,8 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -148,8 +148,8 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
{ {
$driverMock = new DriverMock(); $driverMock = new DriverMock();
$connection = new Connection($this->params, $driverMock); $connection = new Connection($this->params, $driverMock);
$this->assertInstanceOf('Doctrine\Common\EventManager', $connection->getDatabasePlatform()->getEventManager()); self::assertInstanceOf('Doctrine\Common\EventManager', $connection->getDatabasePlatform()->getEventManager());
$this->assertSame($connection->getEventManager(), $connection->getDatabasePlatform()->getEventManager()); self::assertSame($connection->getEventManager(), $connection->getDatabasePlatform()->getEventManager());
} }
/** /**
...@@ -189,7 +189,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -189,7 +189,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
{ {
$logger = new \Doctrine\DBAL\Logging\EchoSQLLogger(); $logger = new \Doctrine\DBAL\Logging\EchoSQLLogger();
$this->_conn->getConfiguration()->setSQLLogger($logger); $this->_conn->getConfiguration()->setSQLLogger($logger);
$this->assertSame($logger, $this->_conn->getConfiguration()->getSQLLogger()); self::assertSame($logger, $this->_conn->getConfiguration()->getSQLLogger());
} }
/** /**
...@@ -201,7 +201,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -201,7 +201,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
{ {
$logger = new \Doctrine\DBAL\Logging\DebugStack(); $logger = new \Doctrine\DBAL\Logging\DebugStack();
$this->_conn->getConfiguration()->setSQLLogger($logger); $this->_conn->getConfiguration()->setSQLLogger($logger);
$this->assertSame($logger, $this->_conn->getConfiguration()->getSQLLogger()); self::assertSame($logger, $this->_conn->getConfiguration()->getSQLLogger());
} }
/** /**
...@@ -209,7 +209,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -209,7 +209,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
*/ */
public function testIsAutoCommit() public function testIsAutoCommit()
{ {
$this->assertTrue($this->_conn->isAutoCommit()); self::assertTrue($this->_conn->isAutoCommit());
} }
/** /**
...@@ -218,9 +218,9 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -218,9 +218,9 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
public function testSetAutoCommit() public function testSetAutoCommit()
{ {
$this->_conn->setAutoCommit(false); $this->_conn->setAutoCommit(false);
$this->assertFalse($this->_conn->isAutoCommit()); self::assertFalse($this->_conn->isAutoCommit());
$this->_conn->setAutoCommit(0); $this->_conn->setAutoCommit(0);
$this->assertFalse($this->_conn->isAutoCommit()); self::assertFalse($this->_conn->isAutoCommit());
} }
/** /**
...@@ -236,11 +236,11 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -236,11 +236,11 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
$conn->setAutoCommit(false); $conn->setAutoCommit(false);
$this->assertFalse($conn->isTransactionActive()); self::assertFalse($conn->isTransactionActive());
$conn->connect(); $conn->connect();
$this->assertTrue($conn->isTransactionActive()); self::assertTrue($conn->isTransactionActive());
} }
/** /**
...@@ -258,7 +258,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -258,7 +258,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
$conn->connect(); $conn->connect();
$conn->commit(); $conn->commit();
$this->assertTrue($conn->isTransactionActive()); self::assertTrue($conn->isTransactionActive());
} }
/** /**
...@@ -276,7 +276,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -276,7 +276,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
$conn->connect(); $conn->connect();
$conn->rollBack(); $conn->rollBack();
$this->assertTrue($conn->isTransactionActive()); self::assertTrue($conn->isTransactionActive());
} }
/** /**
...@@ -295,13 +295,13 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -295,13 +295,13 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
$conn->beginTransaction(); $conn->beginTransaction();
$conn->setAutoCommit(false); $conn->setAutoCommit(false);
$this->assertSame(1, $conn->getTransactionNestingLevel()); self::assertSame(1, $conn->getTransactionNestingLevel());
$conn->beginTransaction(); $conn->beginTransaction();
$conn->beginTransaction(); $conn->beginTransaction();
$conn->setAutoCommit(true); $conn->setAutoCommit(true);
$this->assertFalse($conn->isTransactionActive()); self::assertFalse($conn->isTransactionActive());
} }
public function testEmptyInsert() public function testEmptyInsert()
...@@ -507,7 +507,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -507,7 +507,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
->with($statement, $params, $types) ->with($statement, $params, $types)
->will($this->returnValue($driverStatementMock)); ->will($this->returnValue($driverStatementMock));
$this->assertSame($result, $conn->fetchAssoc($statement, $params, $types)); self::assertSame($result, $conn->fetchAssoc($statement, $params, $types));
} }
public function testFetchArray() public function testFetchArray()
...@@ -541,7 +541,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -541,7 +541,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
->with($statement, $params, $types) ->with($statement, $params, $types)
->will($this->returnValue($driverStatementMock)); ->will($this->returnValue($driverStatementMock));
$this->assertSame($result, $conn->fetchArray($statement, $params, $types)); self::assertSame($result, $conn->fetchArray($statement, $params, $types));
} }
public function testFetchColumn() public function testFetchColumn()
...@@ -576,7 +576,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -576,7 +576,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
->with($statement, $params, $types) ->with($statement, $params, $types)
->will($this->returnValue($driverStatementMock)); ->will($this->returnValue($driverStatementMock));
$this->assertSame($result, $conn->fetchColumn($statement, $params, $column, $types)); self::assertSame($result, $conn->fetchColumn($statement, $params, $column, $types));
} }
public function testConnectionIsClosedButNotUnset() public function testConnectionIsClosedButNotUnset()
...@@ -599,7 +599,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -599,7 +599,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
// the wrapped connection should be null // the wrapped connection should be null
// (and since connect() does nothing, this will not reconnect) // (and since connect() does nothing, this will not reconnect)
// this will also fail if this _conn property was unset instead of set to null // this will also fail if this _conn property was unset instead of set to null
$this->assertNull($connection->getWrappedConnection()); self::assertNull($connection->getWrappedConnection());
} }
public function testFetchAll() public function testFetchAll()
...@@ -632,7 +632,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -632,7 +632,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
->with($statement, $params, $types) ->with($statement, $params, $types)
->will($this->returnValue($driverStatementMock)); ->will($this->returnValue($driverStatementMock));
$this->assertSame($result, $conn->fetchAll($statement, $params, $types)); self::assertSame($result, $conn->fetchAll($statement, $params, $types));
} }
public function testConnectionDoesNotMaintainTwoReferencesToExternalPDO() public function testConnectionDoesNotMaintainTwoReferencesToExternalPDO()
...@@ -643,7 +643,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -643,7 +643,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
$conn = new Connection($params, $driverMock); $conn = new Connection($params, $driverMock);
$this->assertArrayNotHasKey('pdo', $conn->getParams(), "Connection is maintaining additional reference to the PDO connection"); self::assertArrayNotHasKey('pdo', $conn->getParams(), "Connection is maintaining additional reference to the PDO connection");
} }
public function testPassingExternalPDOMeansConnectionIsConnected() public function testPassingExternalPDOMeansConnectionIsConnected()
...@@ -654,7 +654,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -654,7 +654,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
$conn = new Connection($params, $driverMock); $conn = new Connection($params, $driverMock);
$this->assertTrue($conn->isConnected(), "Connection is not connected after passing external PDO"); self::assertTrue($conn->isConnected(), "Connection is not connected after passing external PDO");
} }
public function testCallingDeleteWithNoDeletionCriteriaResultsInInvalidArgumentException() public function testCallingDeleteWithNoDeletionCriteriaResultsInInvalidArgumentException()
...@@ -741,7 +741,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -741,7 +741,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
->with('6.6.6') ->with('6.6.6')
->will($this->returnValue($platformMock)); ->will($this->returnValue($platformMock));
$this->assertSame($platformMock, $connection->getDatabasePlatform()); self::assertSame($platformMock, $connection->getDatabasePlatform());
} }
public function testConnectionParamsArePassedToTheQueryCacheProfileInExecuteCacheQuery() public function testConnectionParamsArePassedToTheQueryCacheProfileInExecuteCacheQuery()
...@@ -776,7 +776,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase ...@@ -776,7 +776,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
/* @var $driver Driver */ /* @var $driver Driver */
$driver = $this->createMock(Driver::class); $driver = $this->createMock(Driver::class);
$this->assertInstanceOf( self::assertInstanceOf(
ArrayStatement::class, ArrayStatement::class,
(new Connection($this->params, $driver))->executeCacheQuery($query, $params, $types, $queryCacheProfileMock) (new Connection($this->params, $driver))->executeCacheQuery($query, $params, $types, $queryCacheProfileMock)
); );
......
...@@ -15,7 +15,7 @@ class DBALExceptionTest extends DbalTestCase ...@@ -15,7 +15,7 @@ class DBALExceptionTest extends DbalTestCase
/* @var $driver Driver */ /* @var $driver Driver */
$driver = $this->createMock(Driver::class); $driver = $this->createMock(Driver::class);
$e = DBALException::driverExceptionDuringQuery($driver, new \Exception, '', array('ABC', chr(128))); $e = DBALException::driverExceptionDuringQuery($driver, new \Exception, '', array('ABC', chr(128)));
$this->assertContains('with params ["ABC", "\x80"]', $e->getMessage()); self::assertContains('with params ["ABC", "\x80"]', $e->getMessage());
} }
public function testAvoidOverWrappingOnDriverException() public function testAvoidOverWrappingOnDriverException()
...@@ -40,7 +40,7 @@ class DBALExceptionTest extends DbalTestCase ...@@ -40,7 +40,7 @@ class DBALExceptionTest extends DbalTestCase
}; };
$ex = new DriverException('', $inner); $ex = new DriverException('', $inner);
$e = DBALException::driverExceptionDuringQuery($driver, $ex, ''); $e = DBALException::driverExceptionDuringQuery($driver, $ex, '');
$this->assertSame($ex, $e); self::assertSame($ex, $e);
} }
public function testDriverRequiredWithUrl() public function testDriverRequiredWithUrl()
...@@ -48,8 +48,8 @@ class DBALExceptionTest extends DbalTestCase ...@@ -48,8 +48,8 @@ class DBALExceptionTest extends DbalTestCase
$url = 'mysql://localhost'; $url = 'mysql://localhost';
$exception = DBALException::driverRequired($url); $exception = DBALException::driverRequired($url);
$this->assertInstanceOf(DBALException::class, $exception); self::assertInstanceOf(DBALException::class, $exception);
$this->assertSame( self::assertSame(
sprintf( sprintf(
"The options 'driver' or 'driverClass' are mandatory if a connection URL without scheme " . "The options 'driver' or 'driverClass' are mandatory if a connection URL without scheme " .
'is given to DriverManager::getConnection(). Given URL: %s', 'is given to DriverManager::getConnection(). Given URL: %s',
......
...@@ -95,11 +95,11 @@ abstract class AbstractDriverTest extends DbalTestCase ...@@ -95,11 +95,11 @@ abstract class AbstractDriverTest extends DbalTestCase
$convertedException = $this->driver->convertException($message, $driverException); $convertedException = $this->driver->convertException($message, $driverException);
$this->assertSame($convertedExceptionClassName, get_class($convertedException)); self::assertSame($convertedExceptionClassName, get_class($convertedException));
$this->assertSame($driverException->getErrorCode(), $convertedException->getErrorCode()); self::assertSame($driverException->getErrorCode(), $convertedException->getErrorCode());
$this->assertSame($driverException->getSQLState(), $convertedException->getSQLState()); self::assertSame($driverException->getSQLState(), $convertedException->getSQLState());
$this->assertSame($message, $convertedException->getMessage()); self::assertSame($message, $convertedException->getMessage());
} }
} }
...@@ -122,7 +122,7 @@ abstract class AbstractDriverTest extends DbalTestCase ...@@ -122,7 +122,7 @@ abstract class AbstractDriverTest extends DbalTestCase
} }
foreach ($data as $item) { foreach ($data as $item) {
$this->assertSame($item[1], get_class($this->driver->createDatabasePlatformForVersion($item[0]))); self::assertSame($item[1], get_class($this->driver->createDatabasePlatformForVersion($item[0])));
} }
} }
...@@ -152,12 +152,12 @@ abstract class AbstractDriverTest extends DbalTestCase ...@@ -152,12 +152,12 @@ abstract class AbstractDriverTest extends DbalTestCase
->method('getParams') ->method('getParams')
->will($this->returnValue($params)); ->will($this->returnValue($params));
$this->assertSame($params['dbname'], $this->driver->getDatabase($connection)); self::assertSame($params['dbname'], $this->driver->getDatabase($connection));
} }
public function testReturnsDatabasePlatform() public function testReturnsDatabasePlatform()
{ {
$this->assertEquals($this->createPlatform(), $this->driver->getDatabasePlatform()); self::assertEquals($this->createPlatform(), $this->driver->getDatabasePlatform());
} }
public function testReturnsSchemaManager() public function testReturnsSchemaManager()
...@@ -165,8 +165,8 @@ abstract class AbstractDriverTest extends DbalTestCase ...@@ -165,8 +165,8 @@ abstract class AbstractDriverTest extends DbalTestCase
$connection = $this->getConnectionMock(); $connection = $this->getConnectionMock();
$schemaManager = $this->driver->getSchemaManager($connection); $schemaManager = $this->driver->getSchemaManager($connection);
$this->assertEquals($this->createSchemaManager($connection), $schemaManager); self::assertEquals($this->createSchemaManager($connection), $schemaManager);
$this->assertAttributeSame($connection, '_conn', $schemaManager); self::assertAttributeSame($connection, '_conn', $schemaManager);
} }
/** /**
......
...@@ -34,7 +34,7 @@ class AbstractMySQLDriverTest extends AbstractDriverTest ...@@ -34,7 +34,7 @@ class AbstractMySQLDriverTest extends AbstractDriverTest
->method('query') ->method('query')
->will($this->returnValue($statement)); ->will($this->returnValue($statement));
$this->assertSame($database, $this->driver->getDatabase($connection)); self::assertSame($database, $this->driver->getDatabase($connection));
} }
protected function createDriver() protected function createDriver()
......
...@@ -22,7 +22,7 @@ class AbstractOracleDriverTest extends AbstractDriverTest ...@@ -22,7 +22,7 @@ class AbstractOracleDriverTest extends AbstractDriverTest
->method('getParams') ->method('getParams')
->will($this->returnValue($params)); ->will($this->returnValue($params));
$this->assertSame($params['user'], $this->driver->getDatabase($connection)); self::assertSame($params['user'], $this->driver->getDatabase($connection));
} }
public function testReturnsDatabaseNameWithConnectDescriptor() public function testReturnsDatabaseNameWithConnectDescriptor()
...@@ -41,7 +41,7 @@ class AbstractOracleDriverTest extends AbstractDriverTest ...@@ -41,7 +41,7 @@ class AbstractOracleDriverTest extends AbstractDriverTest
->method('getParams') ->method('getParams')
->will($this->returnValue($params)); ->will($this->returnValue($params));
$this->assertSame($params['user'], $this->driver->getDatabase($connection)); self::assertSame($params['user'], $this->driver->getDatabase($connection));
} }
protected function createDriver() protected function createDriver()
......
...@@ -34,7 +34,7 @@ class AbstractPostgreSQLDriverTest extends AbstractDriverTest ...@@ -34,7 +34,7 @@ class AbstractPostgreSQLDriverTest extends AbstractDriverTest
->method('query') ->method('query')
->will($this->returnValue($statement)); ->will($this->returnValue($statement));
$this->assertSame($database, $this->driver->getDatabase($connection)); self::assertSame($database, $this->driver->getDatabase($connection));
} }
protected function createDriver() protected function createDriver()
......
...@@ -23,7 +23,7 @@ class AbstractSQLiteDriverTest extends AbstractDriverTest ...@@ -23,7 +23,7 @@ class AbstractSQLiteDriverTest extends AbstractDriverTest
->method('getParams') ->method('getParams')
->will($this->returnValue($params)); ->will($this->returnValue($params));
$this->assertSame($params['path'], $this->driver->getDatabase($connection)); self::assertSame($params['path'], $this->driver->getDatabase($connection));
} }
protected function createDriver() protected function createDriver()
......
...@@ -12,7 +12,7 @@ class DriverTest extends PDOMySQLDriverTest ...@@ -12,7 +12,7 @@ class DriverTest extends PDOMySQLDriverTest
{ {
public function testReturnsName() public function testReturnsName()
{ {
$this->assertSame('drizzle_pdo_mysql', $this->driver->getName()); self::assertSame('drizzle_pdo_mysql', $this->driver->getName());
} }
public function testThrowsExceptionOnCreatingDatabasePlatformsForInvalidVersion() public function testThrowsExceptionOnCreatingDatabasePlatformsForInvalidVersion()
......
...@@ -28,6 +28,6 @@ class DB2ConnectionTest extends DbalTestCase ...@@ -28,6 +28,6 @@ class DB2ConnectionTest extends DbalTestCase
public function testDoesNotRequireQueryForServerVersion() public function testDoesNotRequireQueryForServerVersion()
{ {
$this->assertFalse($this->connectionMock->requiresQueryForServerVersion()); self::assertFalse($this->connectionMock->requiresQueryForServerVersion());
} }
} }
...@@ -9,7 +9,7 @@ class DriverTest extends AbstractDB2DriverTest ...@@ -9,7 +9,7 @@ class DriverTest extends AbstractDB2DriverTest
{ {
public function testReturnsName() public function testReturnsName()
{ {
$this->assertSame('ibm_db2', $this->driver->getName()); self::assertSame('ibm_db2', $this->driver->getName());
} }
protected function createDriver() protected function createDriver()
......
...@@ -9,7 +9,7 @@ class DriverTest extends AbstractMySQLDriverTest ...@@ -9,7 +9,7 @@ class DriverTest extends AbstractMySQLDriverTest
{ {
public function testReturnsName() public function testReturnsName()
{ {
$this->assertSame('mysqli', $this->driver->getName()); self::assertSame('mysqli', $this->driver->getName());
} }
protected function createDriver() protected function createDriver()
......
...@@ -30,7 +30,7 @@ class MysqliConnectionTest extends DbalTestCase ...@@ -30,7 +30,7 @@ class MysqliConnectionTest extends DbalTestCase
public function testDoesNotRequireQueryForServerVersion() public function testDoesNotRequireQueryForServerVersion()
{ {
$this->assertFalse($this->connectionMock->requiresQueryForServerVersion()); self::assertFalse($this->connectionMock->requiresQueryForServerVersion());
} }
public function testRestoresErrorHandlerOnException() public function testRestoresErrorHandlerOnException()
......
...@@ -9,7 +9,7 @@ class DriverTest extends AbstractOracleDriverTest ...@@ -9,7 +9,7 @@ class DriverTest extends AbstractOracleDriverTest
{ {
public function testReturnsName() public function testReturnsName()
{ {
$this->assertSame('oci8', $this->driver->getName()); self::assertSame('oci8', $this->driver->getName());
} }
protected function createDriver() protected function createDriver()
......
...@@ -28,6 +28,6 @@ class OCI8ConnectionTest extends DbalTestCase ...@@ -28,6 +28,6 @@ class OCI8ConnectionTest extends DbalTestCase
public function testDoesNotRequireQueryForServerVersion() public function testDoesNotRequireQueryForServerVersion()
{ {
$this->assertFalse($this->connectionMock->requiresQueryForServerVersion()); self::assertFalse($this->connectionMock->requiresQueryForServerVersion());
} }
} }
...@@ -44,26 +44,26 @@ class PDOExceptionTest extends DbalTestCase ...@@ -44,26 +44,26 @@ class PDOExceptionTest extends DbalTestCase
public function testReturnsCode() public function testReturnsCode()
{ {
$this->assertSame(self::SQLSTATE, $this->exception->getCode()); self::assertSame(self::SQLSTATE, $this->exception->getCode());
} }
public function testReturnsErrorCode() public function testReturnsErrorCode()
{ {
$this->assertSame(self::ERROR_CODE, $this->exception->getErrorCode()); self::assertSame(self::ERROR_CODE, $this->exception->getErrorCode());
} }
public function testReturnsMessage() public function testReturnsMessage()
{ {
$this->assertSame(self::MESSAGE, $this->exception->getMessage()); self::assertSame(self::MESSAGE, $this->exception->getMessage());
} }
public function testReturnsSQLState() public function testReturnsSQLState()
{ {
$this->assertSame(self::SQLSTATE, $this->exception->getSQLState()); self::assertSame(self::SQLSTATE, $this->exception->getSQLState());
} }
public function testOriginalExceptionIsInChain() public function testOriginalExceptionIsInChain()
{ {
$this->assertSame($this->wrappedException, $this->exception->getPrevious()); self::assertSame($this->wrappedException, $this->exception->getPrevious());
} }
} }
...@@ -9,7 +9,7 @@ class DriverTest extends AbstractDB2DriverTest ...@@ -9,7 +9,7 @@ class DriverTest extends AbstractDB2DriverTest
{ {
public function testReturnsName() public function testReturnsName()
{ {
$this->assertSame('pdo_ibm', $this->driver->getName()); self::assertSame('pdo_ibm', $this->driver->getName());
} }
protected function createDriver() protected function createDriver()
......
...@@ -9,7 +9,7 @@ class DriverTest extends AbstractMySQLDriverTest ...@@ -9,7 +9,7 @@ class DriverTest extends AbstractMySQLDriverTest
{ {
public function testReturnsName() public function testReturnsName()
{ {
$this->assertSame('pdo_mysql', $this->driver->getName()); self::assertSame('pdo_mysql', $this->driver->getName());
} }
protected function createDriver() protected function createDriver()
......
...@@ -9,7 +9,7 @@ class DriverTest extends AbstractOracleDriverTest ...@@ -9,7 +9,7 @@ class DriverTest extends AbstractOracleDriverTest
{ {
public function testReturnsName() public function testReturnsName()
{ {
$this->assertSame('pdo_oracle', $this->driver->getName()); self::assertSame('pdo_oracle', $this->driver->getName());
} }
protected function createDriver() protected function createDriver()
......
...@@ -11,7 +11,7 @@ class DriverTest extends AbstractPostgreSQLDriverTest ...@@ -11,7 +11,7 @@ class DriverTest extends AbstractPostgreSQLDriverTest
{ {
public function testReturnsName() public function testReturnsName()
{ {
$this->assertSame('pdo_pgsql', $this->driver->getName()); self::assertSame('pdo_pgsql', $this->driver->getName());
} }
/** /**
...@@ -30,10 +30,10 @@ class DriverTest extends AbstractPostgreSQLDriverTest ...@@ -30,10 +30,10 @@ class DriverTest extends AbstractPostgreSQLDriverTest
$GLOBALS['db_password'] $GLOBALS['db_password']
); );
$this->assertInstanceOf('Doctrine\DBAL\Driver\PDOConnection', $connection); self::assertInstanceOf('Doctrine\DBAL\Driver\PDOConnection', $connection);
try { try {
$this->assertTrue($connection->getAttribute(PDO::PGSQL_ATTR_DISABLE_PREPARES)); self::assertTrue($connection->getAttribute(PDO::PGSQL_ATTR_DISABLE_PREPARES));
} catch (PDOException $ignored) { } catch (PDOException $ignored) {
/** @link https://bugs.php.net/bug.php?id=68371 */ /** @link https://bugs.php.net/bug.php?id=68371 */
$this->markTestIncomplete('See https://bugs.php.net/bug.php?id=68371'); $this->markTestIncomplete('See https://bugs.php.net/bug.php?id=68371');
...@@ -57,10 +57,10 @@ class DriverTest extends AbstractPostgreSQLDriverTest ...@@ -57,10 +57,10 @@ class DriverTest extends AbstractPostgreSQLDriverTest
array(PDO::PGSQL_ATTR_DISABLE_PREPARES => false) array(PDO::PGSQL_ATTR_DISABLE_PREPARES => false)
); );
$this->assertInstanceOf('Doctrine\DBAL\Driver\PDOConnection', $connection); self::assertInstanceOf('Doctrine\DBAL\Driver\PDOConnection', $connection);
try { try {
$this->assertNotSame(true, $connection->getAttribute(PDO::PGSQL_ATTR_DISABLE_PREPARES)); self::assertNotSame(true, $connection->getAttribute(PDO::PGSQL_ATTR_DISABLE_PREPARES));
} catch (PDOException $ignored) { } catch (PDOException $ignored) {
/** @link https://bugs.php.net/bug.php?id=68371 */ /** @link https://bugs.php.net/bug.php?id=68371 */
$this->markTestIncomplete('See https://bugs.php.net/bug.php?id=68371'); $this->markTestIncomplete('See https://bugs.php.net/bug.php?id=68371');
...@@ -84,10 +84,10 @@ class DriverTest extends AbstractPostgreSQLDriverTest ...@@ -84,10 +84,10 @@ class DriverTest extends AbstractPostgreSQLDriverTest
array(PDO::PGSQL_ATTR_DISABLE_PREPARES => true) array(PDO::PGSQL_ATTR_DISABLE_PREPARES => true)
); );
$this->assertInstanceOf('Doctrine\DBAL\Driver\PDOConnection', $connection); self::assertInstanceOf('Doctrine\DBAL\Driver\PDOConnection', $connection);
try { try {
$this->assertTrue($connection->getAttribute(PDO::PGSQL_ATTR_DISABLE_PREPARES)); self::assertTrue($connection->getAttribute(PDO::PGSQL_ATTR_DISABLE_PREPARES));
} catch (PDOException $ignored) { } catch (PDOException $ignored) {
/** @link https://bugs.php.net/bug.php?id=68371 */ /** @link https://bugs.php.net/bug.php?id=68371 */
$this->markTestIncomplete('See https://bugs.php.net/bug.php?id=68371'); $this->markTestIncomplete('See https://bugs.php.net/bug.php?id=68371');
......
...@@ -9,7 +9,7 @@ class DriverTest extends AbstractSQLiteDriverTest ...@@ -9,7 +9,7 @@ class DriverTest extends AbstractSQLiteDriverTest
{ {
public function testReturnsName() public function testReturnsName()
{ {
$this->assertSame('pdo_sqlite', $this->driver->getName()); self::assertSame('pdo_sqlite', $this->driver->getName());
} }
protected function createDriver() protected function createDriver()
......
...@@ -9,7 +9,7 @@ class DriverTest extends AbstractSQLServerDriverTest ...@@ -9,7 +9,7 @@ class DriverTest extends AbstractSQLServerDriverTest
{ {
public function testReturnsName() public function testReturnsName()
{ {
$this->assertSame('pdo_sqlsrv', $this->driver->getName()); self::assertSame('pdo_sqlsrv', $this->driver->getName());
} }
protected function createDriver() protected function createDriver()
......
...@@ -9,7 +9,7 @@ class DriverTest extends AbstractSQLAnywhereDriverTest ...@@ -9,7 +9,7 @@ class DriverTest extends AbstractSQLAnywhereDriverTest
{ {
public function testReturnsName() public function testReturnsName()
{ {
$this->assertSame('sqlanywhere', $this->driver->getName()); self::assertSame('sqlanywhere', $this->driver->getName());
} }
protected function createDriver() protected function createDriver()
......
...@@ -28,6 +28,6 @@ class SQLAnywhereConnectionTest extends DbalTestCase ...@@ -28,6 +28,6 @@ class SQLAnywhereConnectionTest extends DbalTestCase
public function testRequiresQueryForServerVersion() public function testRequiresQueryForServerVersion()
{ {
$this->assertTrue($this->connectionMock->requiresQueryForServerVersion()); self::assertTrue($this->connectionMock->requiresQueryForServerVersion());
} }
} }
...@@ -9,7 +9,7 @@ class DriverTest extends AbstractSQLServerDriverTest ...@@ -9,7 +9,7 @@ class DriverTest extends AbstractSQLServerDriverTest
{ {
public function testReturnsName() public function testReturnsName()
{ {
$this->assertSame('sqlsrv', $this->driver->getName()); self::assertSame('sqlsrv', $this->driver->getName());
} }
protected function createDriver() protected function createDriver()
......
...@@ -28,6 +28,6 @@ class SQLSrvConnectionTest extends DbalTestCase ...@@ -28,6 +28,6 @@ class SQLSrvConnectionTest extends DbalTestCase
public function testDoesNotRequireQueryForServerVersion() public function testDoesNotRequireQueryForServerVersion()
{ {
$this->assertFalse($this->connectionMock->requiresQueryForServerVersion()); self::assertFalse($this->connectionMock->requiresQueryForServerVersion());
} }
} }
...@@ -24,7 +24,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -24,7 +24,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
'pdo' => new \PDO('sqlite::memory:') 'pdo' => new \PDO('sqlite::memory:')
); );
$conn = \Doctrine\DBAL\DriverManager::getConnection($options); $conn = \Doctrine\DBAL\DriverManager::getConnection($options);
$this->assertEquals('sqlite', $conn->getDatabasePlatform()->getName()); self::assertEquals('sqlite', $conn->getDatabasePlatform()->getName());
} }
/** /**
...@@ -39,7 +39,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -39,7 +39,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
); );
$conn = \Doctrine\DBAL\DriverManager::getConnection($options); $conn = \Doctrine\DBAL\DriverManager::getConnection($options);
$this->assertEquals(\PDO::ERRMODE_EXCEPTION, $pdo->getAttribute(\PDO::ATTR_ERRMODE)); self::assertEquals(\PDO::ERRMODE_EXCEPTION, $pdo->getAttribute(\PDO::ATTR_ERRMODE));
} }
/** /**
...@@ -67,7 +67,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -67,7 +67,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
); );
$conn = \Doctrine\DBAL\DriverManager::getConnection($options); $conn = \Doctrine\DBAL\DriverManager::getConnection($options);
$this->assertSame($mockPlatform, $conn->getDatabasePlatform()); self::assertSame($mockPlatform, $conn->getDatabasePlatform());
} }
public function testCustomWrapper() public function testCustomWrapper()
...@@ -80,7 +80,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -80,7 +80,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
); );
$conn = \Doctrine\DBAL\DriverManager::getConnection($options); $conn = \Doctrine\DBAL\DriverManager::getConnection($options);
$this->assertInstanceOf($wrapperClass, $conn); self::assertInstanceOf($wrapperClass, $conn);
} }
public function testInvalidWrapperClass() public function testInvalidWrapperClass()
...@@ -113,7 +113,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -113,7 +113,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
); );
$conn = \Doctrine\DBAL\DriverManager::getConnection($options); $conn = \Doctrine\DBAL\DriverManager::getConnection($options);
$this->assertInstanceOf('Doctrine\DBAL\Driver\PDOMySql\Driver', $conn->getDriver()); self::assertInstanceOf('Doctrine\DBAL\Driver\PDOMySql\Driver', $conn->getDriver());
} }
/** /**
...@@ -134,9 +134,9 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -134,9 +134,9 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
$params = $conn->getParams(); $params = $conn->getParams();
foreach ($expected as $key => $value) { foreach ($expected as $key => $value) {
if (in_array($key, array('pdo', 'driver', 'driverClass'), true)) { if (in_array($key, array('pdo', 'driver', 'driverClass'), true)) {
$this->assertInstanceOf($value, $conn->getDriver()); self::assertInstanceOf($value, $conn->getDriver());
} else { } else {
$this->assertEquals($value, $params[$key]); self::assertEquals($value, $params[$key]);
} }
} }
} }
......
...@@ -26,6 +26,6 @@ class MysqlSessionInitTest extends DbalTestCase ...@@ -26,6 +26,6 @@ class MysqlSessionInitTest extends DbalTestCase
public function testGetSubscribedEvents() public function testGetSubscribedEvents()
{ {
$listener = new MysqlSessionInit(); $listener = new MysqlSessionInit();
$this->assertEquals(array(Events::postConnect), $listener->getSubscribedEvents()); self::assertEquals(array(Events::postConnect), $listener->getSubscribedEvents());
} }
} }
...@@ -54,6 +54,6 @@ class OracleSessionInitTest extends DbalTestCase ...@@ -54,6 +54,6 @@ class OracleSessionInitTest extends DbalTestCase
public function testGetSubscribedEvents() public function testGetSubscribedEvents()
{ {
$listener = new OracleSessionInit(); $listener = new OracleSessionInit();
$this->assertEquals(array(Events::postConnect), $listener->getSubscribedEvents()); self::assertEquals(array(Events::postConnect), $listener->getSubscribedEvents());
} }
} }
...@@ -28,6 +28,6 @@ class SQLSessionInitTest extends DbalTestCase ...@@ -28,6 +28,6 @@ class SQLSessionInitTest extends DbalTestCase
public function testGetSubscribedEvents() public function testGetSubscribedEvents()
{ {
$listener = new SQLSessionInit("SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'"); $listener = new SQLSessionInit("SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'");
$this->assertEquals(array(Events::postConnect), $listener->getSubscribedEvents()); self::assertEquals(array(Events::postConnect), $listener->getSubscribedEvents());
} }
} }
...@@ -34,7 +34,7 @@ class InvalidArgumentExceptionTest extends \PHPUnit\Framework\TestCase ...@@ -34,7 +34,7 @@ class InvalidArgumentExceptionTest extends \PHPUnit\Framework\TestCase
{ {
$exception = InvalidArgumentException::fromEmptyCriteria(); $exception = InvalidArgumentException::fromEmptyCriteria();
$this->assertInstanceOf('Doctrine\DBAL\Exception\InvalidArgumentException', $exception); self::assertInstanceOf('Doctrine\DBAL\Exception\InvalidArgumentException', $exception);
$this->assertSame('Empty criteria was used, expected non-empty criteria', $exception->getMessage()); self::assertSame('Empty criteria was used, expected non-empty criteria', $exception->getMessage());
} }
} }
...@@ -41,12 +41,12 @@ class BlobTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -41,12 +41,12 @@ class BlobTest extends \Doctrine\Tests\DbalFunctionalTestCase
array('id' => 1, 'clobfield' => 'test', 'blobfield' => 'test', 'binaryfield' => 'test'), array('id' => 1, 'clobfield' => 'test', 'blobfield' => 'test', 'binaryfield' => 'test'),
array(\PDO::PARAM_INT, \PDO::PARAM_STR, \PDO::PARAM_LOB, \PDO::PARAM_LOB) array(\PDO::PARAM_INT, \PDO::PARAM_STR, \PDO::PARAM_LOB, \PDO::PARAM_LOB)
); );
$this->assertEquals(1, $ret); self::assertEquals(1, $ret);
} }
public function testSelect() public function testSelect()
{ {
$ret = $this->_conn->insert('blob_table', $this->_conn->insert('blob_table',
array('id' => 1, 'clobfield' => 'test', 'blobfield' => 'test', 'binaryfield' => 'test'), array('id' => 1, 'clobfield' => 'test', 'blobfield' => 'test', 'binaryfield' => 'test'),
array(\PDO::PARAM_INT, \PDO::PARAM_STR, \PDO::PARAM_LOB, \PDO::PARAM_LOB) array(\PDO::PARAM_INT, \PDO::PARAM_STR, \PDO::PARAM_LOB, \PDO::PARAM_LOB)
); );
...@@ -56,7 +56,7 @@ class BlobTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -56,7 +56,7 @@ class BlobTest extends \Doctrine\Tests\DbalFunctionalTestCase
public function testUpdate() public function testUpdate()
{ {
$ret = $this->_conn->insert('blob_table', $this->_conn->insert('blob_table',
array('id' => 1, 'clobfield' => 'test', 'blobfield' => 'test', 'binaryfield' => 'test'), array('id' => 1, 'clobfield' => 'test', 'blobfield' => 'test', 'binaryfield' => 'test'),
array(\PDO::PARAM_INT, \PDO::PARAM_STR, \PDO::PARAM_LOB, \PDO::PARAM_LOB) array(\PDO::PARAM_INT, \PDO::PARAM_STR, \PDO::PARAM_LOB, \PDO::PARAM_LOB)
); );
...@@ -75,25 +75,25 @@ class BlobTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -75,25 +75,25 @@ class BlobTest extends \Doctrine\Tests\DbalFunctionalTestCase
{ {
$rows = $this->_conn->fetchAll('SELECT * FROM blob_table'); $rows = $this->_conn->fetchAll('SELECT * FROM blob_table');
$this->assertEquals(1, count($rows)); self::assertEquals(1, count($rows));
$row = array_change_key_case($rows[0], CASE_LOWER); $row = array_change_key_case($rows[0], CASE_LOWER);
$blobValue = Type::getType('binary')->convertToPHPValue($row['binaryfield'], $this->_conn->getDatabasePlatform()); $blobValue = Type::getType('binary')->convertToPHPValue($row['binaryfield'], $this->_conn->getDatabasePlatform());
$this->assertInternalType('resource', $blobValue); self::assertInternalType('resource', $blobValue);
$this->assertEquals($text, stream_get_contents($blobValue)); self::assertEquals($text, stream_get_contents($blobValue));
} }
private function assertBlobContains($text) private function assertBlobContains($text)
{ {
$rows = $this->_conn->fetchAll('SELECT * FROM blob_table'); $rows = $this->_conn->fetchAll('SELECT * FROM blob_table');
$this->assertEquals(1, count($rows)); self::assertEquals(1, count($rows));
$row = array_change_key_case($rows[0], CASE_LOWER); $row = array_change_key_case($rows[0], CASE_LOWER);
$blobValue = Type::getType('blob')->convertToPHPValue($row['blobfield'], $this->_conn->getDatabasePlatform()); $blobValue = Type::getType('blob')->convertToPHPValue($row['blobfield'], $this->_conn->getDatabasePlatform());
$this->assertInternalType('resource', $blobValue); self::assertInternalType('resource', $blobValue);
$this->assertEquals($text, stream_get_contents($blobValue)); self::assertEquals($text, stream_get_contents($blobValue));
} }
} }
\ No newline at end of file
...@@ -23,7 +23,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -23,7 +23,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
public function testGetWrappedConnection() public function testGetWrappedConnection()
{ {
$this->assertInstanceOf('Doctrine\DBAL\Driver\Connection', $this->_conn->getWrappedConnection()); self::assertInstanceOf('Doctrine\DBAL\Driver\Connection', $this->_conn->getWrappedConnection());
} }
public function testCommitWithRollbackOnlyThrowsException() public function testCommitWithRollbackOnlyThrowsException()
...@@ -39,26 +39,26 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -39,26 +39,26 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
{ {
try { try {
$this->_conn->beginTransaction(); $this->_conn->beginTransaction();
$this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); self::assertEquals(1, $this->_conn->getTransactionNestingLevel());
try { try {
$this->_conn->beginTransaction(); $this->_conn->beginTransaction();
$this->assertEquals(2, $this->_conn->getTransactionNestingLevel()); self::assertEquals(2, $this->_conn->getTransactionNestingLevel());
throw new \Exception; throw new \Exception;
$this->_conn->commit(); // never reached $this->_conn->commit(); // never reached
} catch (\Exception $e) { } catch (\Exception $e) {
$this->_conn->rollBack(); $this->_conn->rollBack();
$this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); self::assertEquals(1, $this->_conn->getTransactionNestingLevel());
//no rethrow //no rethrow
} }
$this->assertTrue($this->_conn->isRollbackOnly()); self::assertTrue($this->_conn->isRollbackOnly());
$this->_conn->commit(); // should throw exception $this->_conn->commit(); // should throw exception
$this->fail('Transaction commit after failed nested transaction should fail.'); $this->fail('Transaction commit after failed nested transaction should fail.');
} catch (ConnectionException $e) { } catch (ConnectionException $e) {
$this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); self::assertEquals(1, $this->_conn->getTransactionNestingLevel());
$this->_conn->rollBack(); $this->_conn->rollBack();
$this->assertEquals(0, $this->_conn->getTransactionNestingLevel()); self::assertEquals(0, $this->_conn->getTransactionNestingLevel());
} }
} }
...@@ -71,28 +71,28 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -71,28 +71,28 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->setNestTransactionsWithSavepoints(true); $this->_conn->setNestTransactionsWithSavepoints(true);
try { try {
$this->_conn->beginTransaction(); $this->_conn->beginTransaction();
$this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); self::assertEquals(1, $this->_conn->getTransactionNestingLevel());
try { try {
$this->_conn->beginTransaction(); $this->_conn->beginTransaction();
$this->assertEquals(2, $this->_conn->getTransactionNestingLevel()); self::assertEquals(2, $this->_conn->getTransactionNestingLevel());
$this->_conn->beginTransaction(); $this->_conn->beginTransaction();
$this->assertEquals(3, $this->_conn->getTransactionNestingLevel()); self::assertEquals(3, $this->_conn->getTransactionNestingLevel());
$this->_conn->commit(); $this->_conn->commit();
$this->assertEquals(2, $this->_conn->getTransactionNestingLevel()); self::assertEquals(2, $this->_conn->getTransactionNestingLevel());
throw new \Exception; throw new \Exception;
$this->_conn->commit(); // never reached $this->_conn->commit(); // never reached
} catch (\Exception $e) { } catch (\Exception $e) {
$this->_conn->rollBack(); $this->_conn->rollBack();
$this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); self::assertEquals(1, $this->_conn->getTransactionNestingLevel());
//no rethrow //no rethrow
} }
$this->assertFalse($this->_conn->isRollbackOnly()); self::assertFalse($this->_conn->isRollbackOnly());
try { try {
$this->_conn->setNestTransactionsWithSavepoints(false); $this->_conn->setNestTransactionsWithSavepoints(false);
$this->fail('Should not be able to disable savepoints in usage for nested transactions inside an open transaction.'); $this->fail('Should not be able to disable savepoints in usage for nested transactions inside an open transaction.');
} catch (ConnectionException $e) { } catch (ConnectionException $e) {
$this->assertTrue($this->_conn->getNestTransactionsWithSavepoints()); self::assertTrue($this->_conn->getNestTransactionsWithSavepoints());
} }
$this->_conn->commit(); // should not throw exception $this->_conn->commit(); // should not throw exception
} catch (ConnectionException $e) { } catch (ConnectionException $e) {
...@@ -164,15 +164,15 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -164,15 +164,15 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
{ {
try { try {
$this->_conn->beginTransaction(); $this->_conn->beginTransaction();
$this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); self::assertEquals(1, $this->_conn->getTransactionNestingLevel());
throw new \Exception; throw new \Exception;
$this->_conn->commit(); // never reached $this->_conn->commit(); // never reached
} catch (\Exception $e) { } catch (\Exception $e) {
$this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); self::assertEquals(1, $this->_conn->getTransactionNestingLevel());
$this->_conn->rollBack(); $this->_conn->rollBack();
$this->assertEquals(0, $this->_conn->getTransactionNestingLevel()); self::assertEquals(0, $this->_conn->getTransactionNestingLevel());
} }
} }
...@@ -180,14 +180,14 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -180,14 +180,14 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
{ {
try { try {
$this->_conn->beginTransaction(); $this->_conn->beginTransaction();
$this->assertEquals(1, $this->_conn->getTransactionNestingLevel()); self::assertEquals(1, $this->_conn->getTransactionNestingLevel());
$this->_conn->commit(); $this->_conn->commit();
} catch (\Exception $e) { } catch (\Exception $e) {
$this->_conn->rollBack(); $this->_conn->rollBack();
$this->assertEquals(0, $this->_conn->getTransactionNestingLevel()); self::assertEquals(0, $this->_conn->getTransactionNestingLevel());
} }
$this->assertEquals(0, $this->_conn->getTransactionNestingLevel()); self::assertEquals(0, $this->_conn->getTransactionNestingLevel());
} }
public function testTransactionalWithException() public function testTransactionalWithException()
...@@ -200,7 +200,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -200,7 +200,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
}); });
$this->fail('Expected exception'); $this->fail('Expected exception');
} catch (\RuntimeException $expected) { } catch (\RuntimeException $expected) {
$this->assertEquals(0, $this->_conn->getTransactionNestingLevel()); self::assertEquals(0, $this->_conn->getTransactionNestingLevel());
} }
} }
...@@ -218,7 +218,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -218,7 +218,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
}); });
$this->fail('Expected exception'); $this->fail('Expected exception');
} catch (\Error $expected) { } catch (\Error $expected) {
$this->assertEquals(0, $this->_conn->getTransactionNestingLevel()); self::assertEquals(0, $this->_conn->getTransactionNestingLevel());
} }
} }
...@@ -238,7 +238,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -238,7 +238,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
return 42; return 42;
}); });
$this->assertEquals(42, $res); self::assertEquals(42, $res);
} }
/** /**
...@@ -246,13 +246,13 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -246,13 +246,13 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
*/ */
public function testQuote() public function testQuote()
{ {
$this->assertEquals($this->_conn->quote("foo", Type::STRING), $this->_conn->quote("foo", \PDO::PARAM_STR)); self::assertEquals($this->_conn->quote("foo", Type::STRING), $this->_conn->quote("foo", \PDO::PARAM_STR));
} }
public function testPingDoesTriggersConnect() public function testPingDoesTriggersConnect()
{ {
$this->assertTrue($this->_conn->ping()); self::assertTrue($this->_conn->ping());
$this->assertTrue($this->_conn->isConnected()); self::assertTrue($this->_conn->isConnected());
} }
/** /**
...@@ -273,7 +273,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -273,7 +273,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->getEventManager() $this->_conn->getEventManager()
); );
$this->assertTrue($connection->connect()); self::assertTrue($connection->connect());
$connection->close(); $connection->close();
} }
...@@ -296,9 +296,9 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -296,9 +296,9 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->getEventManager() $this->_conn->getEventManager()
); );
$this->assertInstanceOf(AbstractPlatform::class, $connection->getDatabasePlatform()); self::assertInstanceOf(AbstractPlatform::class, $connection->getDatabasePlatform());
$this->assertFalse($connection->isConnected()); self::assertFalse($connection->isConnected());
$this->assertSame($params, $connection->getParams()); self::assertSame($params, $connection->getParams());
$connection->close(); $connection->close();
} }
......
...@@ -34,7 +34,7 @@ abstract class AbstractDriverTest extends DbalFunctionalTestCase ...@@ -34,7 +34,7 @@ abstract class AbstractDriverTest extends DbalFunctionalTestCase
$connection = $this->driver->connect($params, $user, $password); $connection = $this->driver->connect($params, $user, $password);
$this->assertInstanceOf('Doctrine\DBAL\Driver\Connection', $connection); self::assertInstanceOf('Doctrine\DBAL\Driver\Connection', $connection);
} }
/** /**
...@@ -52,7 +52,7 @@ abstract class AbstractDriverTest extends DbalFunctionalTestCase ...@@ -52,7 +52,7 @@ abstract class AbstractDriverTest extends DbalFunctionalTestCase
$this->_conn->getEventManager() $this->_conn->getEventManager()
); );
$this->assertSame( self::assertSame(
$this->getDatabaseNameForConnectionWithoutDatabaseNameParameter(), $this->getDatabaseNameForConnectionWithoutDatabaseNameParameter(),
$this->driver->getDatabase($connection) $this->driver->getDatabase($connection)
); );
......
...@@ -28,7 +28,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -28,7 +28,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
); );
$connection = $this->getConnection($driverOptions); $connection = $this->getConnection($driverOptions);
$this->assertInstanceOf("\Doctrine\DBAL\Driver\Mysqli\MysqliConnection", $connection); self::assertInstanceOf("\Doctrine\DBAL\Driver\Mysqli\MysqliConnection", $connection);
} }
/** /**
...@@ -42,7 +42,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -42,7 +42,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
public function testPing() public function testPing()
{ {
$conn = $this->getConnection(array()); $conn = $this->getConnection(array());
$this->assertTrue($conn->ping()); self::assertTrue($conn->ping());
} }
private function getConnection(array $driverOptions) private function getConnection(array $driverOptions)
......
...@@ -47,6 +47,6 @@ class OCI8ConnectionTest extends DbalFunctionalTestCase ...@@ -47,6 +47,6 @@ class OCI8ConnectionTest extends DbalFunctionalTestCase
$schema = $this->_conn->getDatabase(); $schema = $this->_conn->getDatabase();
$sequence = $platform->getIdentitySequenceName($schema . '.DBAL2595', 'id'); $sequence = $platform->getIdentitySequenceName($schema . '.DBAL2595', 'id');
$this->assertSame(1, $this->driverConnection->lastInsertId($sequence)); self::assertSame(1, $this->driverConnection->lastInsertId($sequence));
} }
} }
...@@ -25,7 +25,7 @@ class StatementTest extends DbalFunctionalTestCase ...@@ -25,7 +25,7 @@ class StatementTest extends DbalFunctionalTestCase
*/ */
public function testQueryConversion($query, array $params, array $expected) public function testQueryConversion($query, array $params, array $expected)
{ {
$this->assertEquals( self::assertEquals(
$expected, $expected,
$this->_conn->executeQuery($query, $params)->fetch() $this->_conn->executeQuery($query, $params)->fetch()
); );
......
...@@ -38,7 +38,7 @@ class PDOConnectionTest extends DbalFunctionalTestCase ...@@ -38,7 +38,7 @@ class PDOConnectionTest extends DbalFunctionalTestCase
public function testDoesNotRequireQueryForServerVersion() public function testDoesNotRequireQueryForServerVersion()
{ {
$this->assertFalse($this->driverConnection->requiresQueryForServerVersion()); self::assertFalse($this->driverConnection->requiresQueryForServerVersion());
} }
/** /**
......
...@@ -38,7 +38,7 @@ class DriverTest extends AbstractDriverTest ...@@ -38,7 +38,7 @@ class DriverTest extends AbstractDriverTest
$this->_conn->getEventManager() $this->_conn->getEventManager()
); );
$this->assertSame( self::assertSame(
$expectedDatabaseName, $expectedDatabaseName,
$this->driver->getDatabase($connection) $this->driver->getDatabase($connection)
); );
...@@ -82,7 +82,7 @@ class DriverTest extends AbstractDriverTest ...@@ -82,7 +82,7 @@ class DriverTest extends AbstractDriverTest
$queryColumnName = array_key_exists('current_query', $record) ? 'current_query' : 'query'; $queryColumnName = array_key_exists('current_query', $record) ? 'current_query' : 'query';
if ($record[$queryColumnName] === $sql) { if ($record[$queryColumnName] === $sql) {
$this->assertSame('doctrine', $record['application_name']); self::assertSame('doctrine', $record['application_name']);
return; return;
} }
......
...@@ -40,7 +40,7 @@ class PDOPgsqlConnectionTest extends DbalFunctionalTestCase ...@@ -40,7 +40,7 @@ class PDOPgsqlConnectionTest extends DbalFunctionalTestCase
$this->_conn->getEventManager() $this->_conn->getEventManager()
); );
$this->assertEquals($charset, $connection->query("SHOW client_encoding")->fetch(\PDO::FETCH_COLUMN)); self::assertEquals($charset, $connection->query("SHOW client_encoding")->fetch(\PDO::FETCH_COLUMN));
} }
/** /**
......
...@@ -29,7 +29,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -29,7 +29,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$conn->connect(); $conn->connect();
$this->assertTrue($conn->isConnected(), 'No SQLAnywhere-nonpersistent connection established'); self::assertTrue($conn->isConnected(), 'No SQLAnywhere-nonpersistent connection established');
} }
public function testPersistentConnection() public function testPersistentConnection()
...@@ -41,6 +41,6 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -41,6 +41,6 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$conn->connect(); $conn->connect();
$this->assertTrue($conn->isConnected(), 'No SQLAnywhere-persistent connection established'); self::assertTrue($conn->isConnected(), 'No SQLAnywhere-persistent connection established');
} }
} }
...@@ -35,7 +35,7 @@ class DriverTest extends AbstractDriverTest ...@@ -35,7 +35,7 @@ class DriverTest extends AbstractDriverTest
// SQL Anywhere has no "default" database. The name of the default database // SQL Anywhere has no "default" database. The name of the default database
// is defined on server startup and therefore can be arbitrary. // is defined on server startup and therefore can be arbitrary.
$this->assertInternalType('string', $this->driver->getDatabase($connection)); self::assertInternalType('string', $this->driver->getDatabase($connection));
} }
/** /**
......
...@@ -29,10 +29,10 @@ class StatementTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -29,10 +29,10 @@ class StatementTest extends \Doctrine\Tests\DbalFunctionalTestCase
$conn->connect(); $conn->connect();
$this->assertTrue($conn->isConnected(),'No SQLAnywhere-Connection established'); self::assertTrue($conn->isConnected(),'No SQLAnywhere-Connection established');
$prepStmt = $conn->prepare('SELECT 1'); $prepStmt = $conn->prepare('SELECT 1');
$this->assertTrue($prepStmt->execute(),' Statement non-persistent failed'); self::assertTrue($prepStmt->execute(),' Statement non-persistent failed');
} }
public function testPersistentStatement() public function testPersistentStatement()
...@@ -44,10 +44,10 @@ class StatementTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -44,10 +44,10 @@ class StatementTest extends \Doctrine\Tests\DbalFunctionalTestCase
$conn->connect(); $conn->connect();
$this->assertTrue($conn->isConnected(),'No SQLAnywhere-Connection established'); self::assertTrue($conn->isConnected(),'No SQLAnywhere-Connection established');
$prepStmt = $conn->prepare('SELECT 1'); $prepStmt = $conn->prepare('SELECT 1');
$this->assertTrue($prepStmt->execute(),' Statement persistent failed'); self::assertTrue($prepStmt->execute(),' Statement persistent failed');
} }
} }
...@@ -53,11 +53,11 @@ class MasterSlaveConnectionTest extends DbalFunctionalTestCase ...@@ -53,11 +53,11 @@ class MasterSlaveConnectionTest extends DbalFunctionalTestCase
{ {
$conn = $this->createMasterSlaveConnection(); $conn = $this->createMasterSlaveConnection();
$this->assertFalse($conn->isConnectedToMaster()); self::assertFalse($conn->isConnectedToMaster());
$conn->connect('slave'); $conn->connect('slave');
$this->assertFalse($conn->isConnectedToMaster()); self::assertFalse($conn->isConnectedToMaster());
$conn->connect('master'); $conn->connect('master');
$this->assertTrue($conn->isConnectedToMaster()); self::assertTrue($conn->isConnectedToMaster());
} }
public function testNoMasterOnExecuteQuery() public function testNoMasterOnExecuteQuery()
...@@ -68,8 +68,8 @@ class MasterSlaveConnectionTest extends DbalFunctionalTestCase ...@@ -68,8 +68,8 @@ class MasterSlaveConnectionTest extends DbalFunctionalTestCase
$data = $conn->fetchAll($sql); $data = $conn->fetchAll($sql);
$data[0] = array_change_key_case($data[0], CASE_LOWER); $data[0] = array_change_key_case($data[0], CASE_LOWER);
$this->assertEquals(1, $data[0]['num']); self::assertEquals(1, $data[0]['num']);
$this->assertFalse($conn->isConnectedToMaster()); self::assertFalse($conn->isConnectedToMaster());
} }
public function testMasterOnWriteOperation() public function testMasterOnWriteOperation()
...@@ -77,14 +77,14 @@ class MasterSlaveConnectionTest extends DbalFunctionalTestCase ...@@ -77,14 +77,14 @@ class MasterSlaveConnectionTest extends DbalFunctionalTestCase
$conn = $this->createMasterSlaveConnection(); $conn = $this->createMasterSlaveConnection();
$conn->insert('master_slave_table', array('test_int' => 30)); $conn->insert('master_slave_table', array('test_int' => 30));
$this->assertTrue($conn->isConnectedToMaster()); self::assertTrue($conn->isConnectedToMaster());
$sql = "SELECT count(*) as num FROM master_slave_table"; $sql = "SELECT count(*) as num FROM master_slave_table";
$data = $conn->fetchAll($sql); $data = $conn->fetchAll($sql);
$data[0] = array_change_key_case($data[0], CASE_LOWER); $data[0] = array_change_key_case($data[0], CASE_LOWER);
$this->assertEquals(2, $data[0]['num']); self::assertEquals(2, $data[0]['num']);
$this->assertTrue($conn->isConnectedToMaster()); self::assertTrue($conn->isConnectedToMaster());
} }
/** /**
...@@ -99,13 +99,13 @@ class MasterSlaveConnectionTest extends DbalFunctionalTestCase ...@@ -99,13 +99,13 @@ class MasterSlaveConnectionTest extends DbalFunctionalTestCase
$conn->insert('master_slave_table', array('test_int' => 30)); $conn->insert('master_slave_table', array('test_int' => 30));
$conn->commit(); $conn->commit();
$this->assertTrue($conn->isConnectedToMaster()); self::assertTrue($conn->isConnectedToMaster());
$conn->connect(); $conn->connect();
$this->assertTrue($conn->isConnectedToMaster()); self::assertTrue($conn->isConnectedToMaster());
$conn->connect('slave'); $conn->connect('slave');
$this->assertFalse($conn->isConnectedToMaster()); self::assertFalse($conn->isConnectedToMaster());
} }
/** /**
...@@ -118,25 +118,25 @@ class MasterSlaveConnectionTest extends DbalFunctionalTestCase ...@@ -118,25 +118,25 @@ class MasterSlaveConnectionTest extends DbalFunctionalTestCase
$conn->insert('master_slave_table', array('test_int' => 30)); $conn->insert('master_slave_table', array('test_int' => 30));
$this->assertTrue($conn->isConnectedToMaster()); self::assertTrue($conn->isConnectedToMaster());
$conn->connect(); $conn->connect();
$this->assertTrue($conn->isConnectedToMaster()); self::assertTrue($conn->isConnectedToMaster());
$conn->connect('slave'); $conn->connect('slave');
$this->assertFalse($conn->isConnectedToMaster()); self::assertFalse($conn->isConnectedToMaster());
} }
public function testMasterSlaveConnectionCloseAndReconnect() public function testMasterSlaveConnectionCloseAndReconnect()
{ {
$conn = $this->createMasterSlaveConnection(); $conn = $this->createMasterSlaveConnection();
$conn->connect('master'); $conn->connect('master');
$this->assertTrue($conn->isConnectedToMaster()); self::assertTrue($conn->isConnectedToMaster());
$conn->close(); $conn->close();
$this->assertFalse($conn->isConnectedToMaster()); self::assertFalse($conn->isConnectedToMaster());
$conn->connect('master'); $conn->connect('master');
$this->assertTrue($conn->isConnectedToMaster()); self::assertTrue($conn->isConnectedToMaster());
} }
} }
...@@ -168,9 +168,9 @@ SQL; ...@@ -168,9 +168,9 @@ SQL;
* Do not assert the order of results when results are non-deterministic * Do not assert the order of results when results are non-deterministic
*/ */
if ($deterministic) { if ($deterministic) {
$this->assertEquals($expectedResults, $data); self::assertEquals($expectedResults, $data);
} else { } else {
$this->assertCount(count($expectedResults), $data); self::assertCount(count($expectedResults), $data);
} }
} }
} }
...@@ -157,7 +157,7 @@ class NamedParametersTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -157,7 +157,7 @@ class NamedParametersTest extends \Doctrine\Tests\DbalFunctionalTestCase
$result[$k] = array_change_key_case($v, CASE_LOWER); $result[$k] = array_change_key_case($v, CASE_LOWER);
} }
$this->assertEquals($result, $expected); self::assertEquals($result, $expected);
} }
} }
...@@ -108,7 +108,7 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -108,7 +108,7 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase
public function assertFetchResultRows($rows) public function assertFetchResultRows($rows)
{ {
$this->assertEquals(2, count($rows)); self::assertEquals(2, count($rows));
foreach ($rows as $row) { foreach ($rows as $row) {
$this->assertFetchResultRow($row); $this->assertFetchResultRow($row);
} }
...@@ -116,11 +116,11 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -116,11 +116,11 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase
public function assertFetchResultRow($row) public function assertFetchResultRow($row)
{ {
$this->assertTrue(in_array($row['test_int'], array(1, 2)), "Primary key test_int should either be 1 or 2."); self::assertTrue(in_array($row['test_int'], array(1, 2)), "Primary key test_int should either be 1 or 2.");
$this->assertArrayHasKey('test_string', $row, "Case should be lowered."); self::assertArrayHasKey('test_string', $row, "Case should be lowered.");
$this->assertEquals(3, strlen($row['test_string']), "test_string should be rtrimed to length of three for CHAR(32) column."); self::assertEquals(3, strlen($row['test_string']), "test_string should be rtrimed to length of three for CHAR(32) column.");
$this->assertNull($row['test_null']); self::assertNull($row['test_null']);
$this->assertArrayNotHasKey(0, $row, "PDO::FETCH_ASSOC should not return numerical keys."); self::assertArrayNotHasKey(0, $row, "PDO::FETCH_ASSOC should not return numerical keys.");
} }
public function testPortabilitySqlServer() public function testPortabilitySqlServer()
...@@ -142,7 +142,7 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -142,7 +142,7 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase
$connection->connect($params); $connection->connect($params);
$this->assertEquals($portability, $connection->getPortability()); self::assertEquals($portability, $connection->getPortability());
} }
/** /**
...@@ -154,7 +154,7 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -154,7 +154,7 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt = $conn->query('SELECT ' . $field . ' FROM portability_table'); $stmt = $conn->query('SELECT ' . $field . ' FROM portability_table');
$column = $stmt->fetchAll(PDO::FETCH_COLUMN); $column = $stmt->fetchAll(PDO::FETCH_COLUMN);
$this->assertEquals($expected, $column); self::assertEquals($expected, $column);
} }
public static function fetchAllColumnProvider() public static function fetchAllColumnProvider()
...@@ -177,6 +177,6 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -177,6 +177,6 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt = $conn->query('SELECT Test_Null FROM portability_table'); $stmt = $conn->query('SELECT Test_Null FROM portability_table');
$column = $stmt->fetchAll(PDO::FETCH_COLUMN); $column = $stmt->fetchAll(PDO::FETCH_COLUMN);
$this->assertSame(array(null, null), $column); self::assertSame(array(null, null), $column);
} }
} }
...@@ -44,7 +44,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -44,7 +44,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
public function testCacheFetchAssoc() public function testCacheFetchAssoc()
{ {
$this->assertCacheNonCacheSelectSameFetchModeAreEqual($this->expectedResult, \PDO::FETCH_ASSOC); self::assertCacheNonCacheSelectSameFetchModeAreEqual($this->expectedResult, \PDO::FETCH_ASSOC);
} }
public function testFetchNum() public function testFetchNum()
...@@ -53,7 +53,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -53,7 +53,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
foreach ($this->expectedResult as $v) { foreach ($this->expectedResult as $v) {
$expectedResult[] = array_values($v); $expectedResult[] = array_values($v);
} }
$this->assertCacheNonCacheSelectSameFetchModeAreEqual($expectedResult, \PDO::FETCH_NUM); self::assertCacheNonCacheSelectSameFetchModeAreEqual($expectedResult, \PDO::FETCH_NUM);
} }
public function testFetchBoth() public function testFetchBoth()
...@@ -62,7 +62,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -62,7 +62,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
foreach ($this->expectedResult as $v) { foreach ($this->expectedResult as $v) {
$expectedResult[] = array_merge($v, array_values($v)); $expectedResult[] = array_merge($v, array_values($v));
} }
$this->assertCacheNonCacheSelectSameFetchModeAreEqual($expectedResult, \PDO::FETCH_BOTH); self::assertCacheNonCacheSelectSameFetchModeAreEqual($expectedResult, \PDO::FETCH_BOTH);
} }
public function testFetchColumn() public function testFetchColumn()
...@@ -71,7 +71,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -71,7 +71,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
foreach ($this->expectedResult as $v) { foreach ($this->expectedResult as $v) {
$expectedResult[] = array_shift($v); $expectedResult[] = array_shift($v);
} }
$this->assertCacheNonCacheSelectSameFetchModeAreEqual($expectedResult, \PDO::FETCH_COLUMN); self::assertCacheNonCacheSelectSameFetchModeAreEqual($expectedResult, \PDO::FETCH_COLUMN);
} }
public function testMixingFetch() public function testMixingFetch()
...@@ -84,20 +84,20 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -84,20 +84,20 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
$data = $this->hydrateStmt($stmt, \PDO::FETCH_ASSOC); $data = $this->hydrateStmt($stmt, \PDO::FETCH_ASSOC);
$this->assertEquals($this->expectedResult, $data); self::assertEquals($this->expectedResult, $data);
$stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey")); $stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey"));
$data = $this->hydrateStmt($stmt, \PDO::FETCH_NUM); $data = $this->hydrateStmt($stmt, \PDO::FETCH_NUM);
$this->assertEquals($numExpectedResult, $data); self::assertEquals($numExpectedResult, $data);
} }
public function testIteratorFetch() public function testIteratorFetch()
{ {
$this->assertStandardAndIteratorFetchAreEqual(\PDO::FETCH_BOTH); self::assertStandardAndIteratorFetchAreEqual(\PDO::FETCH_BOTH);
$this->assertStandardAndIteratorFetchAreEqual(\PDO::FETCH_ASSOC); self::assertStandardAndIteratorFetchAreEqual(\PDO::FETCH_ASSOC);
$this->assertStandardAndIteratorFetchAreEqual(\PDO::FETCH_NUM); self::assertStandardAndIteratorFetchAreEqual(\PDO::FETCH_NUM);
} }
public function assertStandardAndIteratorFetchAreEqual($fetchMode) public function assertStandardAndIteratorFetchAreEqual($fetchMode)
...@@ -108,7 +108,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -108,7 +108,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey")); $stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey"));
$data_iterator = $this->hydrateStmtIterator($stmt, $fetchMode); $data_iterator = $this->hydrateStmtIterator($stmt, $fetchMode);
$this->assertEquals($data, $data_iterator); self::assertEquals($data, $data_iterator);
} }
public function testDontCloseNoCache() public function testDontCloseNoCache()
...@@ -127,7 +127,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -127,7 +127,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
$data[] = $row; $data[] = $row;
} }
$this->assertEquals(2, count($this->sqlLogger->queries)); self::assertEquals(2, count($this->sqlLogger->queries));
} }
public function testDontFinishNoCache() public function testDontFinishNoCache()
...@@ -141,23 +141,23 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -141,23 +141,23 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
$data = $this->hydrateStmt($stmt, \PDO::FETCH_NUM); $data = $this->hydrateStmt($stmt, \PDO::FETCH_NUM);
$this->assertEquals(2, count($this->sqlLogger->queries)); self::assertEquals(2, count($this->sqlLogger->queries));
} }
public function assertCacheNonCacheSelectSameFetchModeAreEqual($expectedResult, $fetchMode) public function assertCacheNonCacheSelectSameFetchModeAreEqual($expectedResult, $fetchMode)
{ {
$stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey")); $stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey"));
$this->assertEquals(2, $stmt->columnCount()); self::assertEquals(2, $stmt->columnCount());
$data = $this->hydrateStmt($stmt, $fetchMode); $data = $this->hydrateStmt($stmt, $fetchMode);
$this->assertEquals($expectedResult, $data); self::assertEquals($expectedResult, $data);
$stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey")); $stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey"));
$this->assertEquals(2, $stmt->columnCount()); self::assertEquals(2, $stmt->columnCount());
$data = $this->hydrateStmt($stmt, $fetchMode); $data = $this->hydrateStmt($stmt, $fetchMode);
$this->assertEquals($expectedResult, $data); self::assertEquals($expectedResult, $data);
$this->assertEquals(1, count($this->sqlLogger->queries), "just one dbal hit"); self::assertEquals(1, count($this->sqlLogger->queries), "just one dbal hit");
} }
public function testEmptyResultCache() public function testEmptyResultCache()
...@@ -168,7 +168,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -168,7 +168,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt = $this->_conn->executeQuery("SELECT * FROM caching WHERE test_int > 500", array(), array(), new QueryCacheProfile(10, "emptycachekey")); $stmt = $this->_conn->executeQuery("SELECT * FROM caching WHERE test_int > 500", array(), array(), new QueryCacheProfile(10, "emptycachekey"));
$data = $this->hydrateStmt($stmt); $data = $this->hydrateStmt($stmt);
$this->assertEquals(1, count($this->sqlLogger->queries), "just one dbal hit"); self::assertEquals(1, count($this->sqlLogger->queries), "just one dbal hit");
} }
public function testChangeCacheImpl() public function testChangeCacheImpl()
...@@ -180,8 +180,8 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -180,8 +180,8 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt = $this->_conn->executeQuery("SELECT * FROM caching WHERE test_int > 500", array(), array(), new QueryCacheProfile(10, "emptycachekey", $secondCache)); $stmt = $this->_conn->executeQuery("SELECT * FROM caching WHERE test_int > 500", array(), array(), new QueryCacheProfile(10, "emptycachekey", $secondCache));
$data = $this->hydrateStmt($stmt); $data = $this->hydrateStmt($stmt);
$this->assertEquals(2, count($this->sqlLogger->queries), "two hits"); self::assertEquals(2, count($this->sqlLogger->queries), "two hits");
$this->assertEquals(1, count($secondCache->fetch("emptycachekey"))); self::assertEquals(1, count($secondCache->fetch("emptycachekey")));
} }
private function hydrateStmt($stmt, $fetchMode = \PDO::FETCH_ASSOC) private function hydrateStmt($stmt, $fetchMode = \PDO::FETCH_ASSOC)
......
...@@ -19,10 +19,10 @@ class Db2SchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -19,10 +19,10 @@ class Db2SchemaManagerTest extends SchemaManagerFunctionalTestCase
$columns = $this->_sm->listTableColumns('boolean_column_test'); $columns = $this->_sm->listTableColumns('boolean_column_test');
$this->assertInstanceOf('Doctrine\DBAL\Types\BooleanType', $columns['bool']->getType()); self::assertInstanceOf('Doctrine\DBAL\Types\BooleanType', $columns['bool']->getType());
$this->assertInstanceOf('Doctrine\DBAL\Types\BooleanType', $columns['bool_commented']->getType()); self::assertInstanceOf('Doctrine\DBAL\Types\BooleanType', $columns['bool_commented']->getType());
$this->assertNull($columns['bool']->getComment()); self::assertNull($columns['bool']->getComment());
$this->assertSame("That's a comment", $columns['bool_commented']->getComment()); self::assertSame("That's a comment", $columns['bool_commented']->getComment());
} }
} }
...@@ -20,11 +20,11 @@ class DrizzleSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -20,11 +20,11 @@ class DrizzleSchemaManagerTest extends SchemaManagerFunctionalTestCase
$table = $this->_sm->listTableDetails($tableName); $table = $this->_sm->listTableDetails($tableName);
$this->assertInstanceOf('Doctrine\DBAL\Types\BinaryType', $table->getColumn('column_varbinary')->getType()); self::assertInstanceOf('Doctrine\DBAL\Types\BinaryType', $table->getColumn('column_varbinary')->getType());
$this->assertFalse($table->getColumn('column_varbinary')->getFixed()); self::assertFalse($table->getColumn('column_varbinary')->getFixed());
$this->assertInstanceOf('Doctrine\DBAL\Types\BinaryType', $table->getColumn('column_binary')->getType()); self::assertInstanceOf('Doctrine\DBAL\Types\BinaryType', $table->getColumn('column_binary')->getType());
$this->assertFalse($table->getColumn('column_binary')->getFixed()); self::assertFalse($table->getColumn('column_binary')->getFixed());
} }
public function testColumnCollation() public function testColumnCollation()
...@@ -39,9 +39,9 @@ class DrizzleSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -39,9 +39,9 @@ class DrizzleSchemaManagerTest extends SchemaManagerFunctionalTestCase
$columns = $this->_sm->listTableColumns('test_collation'); $columns = $this->_sm->listTableColumns('test_collation');
$this->assertArrayNotHasKey('collation', $columns['id']->getPlatformOptions()); self::assertArrayNotHasKey('collation', $columns['id']->getPlatformOptions());
$this->assertEquals('utf8_unicode_ci', $columns['text']->getPlatformOption('collation')); self::assertEquals('utf8_unicode_ci', $columns['text']->getPlatformOption('collation'));
$this->assertEquals('utf8_swedish_ci', $columns['foo']->getPlatformOption('collation')); self::assertEquals('utf8_swedish_ci', $columns['foo']->getPlatformOption('collation'));
$this->assertEquals('utf8_general_ci', $columns['bar']->getPlatformOption('collation')); self::assertEquals('utf8_general_ci', $columns['bar']->getPlatformOption('collation'));
} }
} }
...@@ -61,7 +61,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -61,7 +61,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$comparator = new Comparator; $comparator = new Comparator;
$diff = $comparator->diffTable($tableFetched, $table); $diff = $comparator->diffTable($tableFetched, $table);
$this->assertFalse($diff, "no changes expected."); self::assertFalse($diff, "no changes expected.");
} }
public function testFulltextIndex() public function testFulltextIndex()
...@@ -77,8 +77,8 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -77,8 +77,8 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$this->_sm->dropAndCreateTable($table); $this->_sm->dropAndCreateTable($table);
$indexes = $this->_sm->listTableIndexes('fulltext_index'); $indexes = $this->_sm->listTableIndexes('fulltext_index');
$this->assertArrayHasKey('f_index', $indexes); self::assertArrayHasKey('f_index', $indexes);
$this->assertTrue($indexes['f_index']->hasFlag('fulltext')); self::assertTrue($indexes['f_index']->hasFlag('fulltext'));
} }
public function testSpatialIndex() public function testSpatialIndex()
...@@ -94,8 +94,8 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -94,8 +94,8 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$this->_sm->dropAndCreateTable($table); $this->_sm->dropAndCreateTable($table);
$indexes = $this->_sm->listTableIndexes('spatial_index'); $indexes = $this->_sm->listTableIndexes('spatial_index');
$this->assertArrayHasKey('s_index', $indexes); self::assertArrayHasKey('s_index', $indexes);
$this->assertTrue($indexes['s_index']->hasFlag('spatial')); self::assertTrue($indexes['s_index']->hasFlag('spatial'));
} }
/** /**
...@@ -120,8 +120,8 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -120,8 +120,8 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$table = $this->_sm->listTableDetails("alter_table_add_pk"); $table = $this->_sm->listTableDetails("alter_table_add_pk");
$this->assertFalse($table->hasIndex('idx_id')); self::assertFalse($table->hasIndex('idx_id'));
$this->assertTrue($table->hasPrimaryKey()); self::assertTrue($table->hasPrimaryKey());
} }
/** /**
...@@ -146,8 +146,8 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -146,8 +146,8 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$table = $this->_sm->listTableDetails("drop_primary_key"); $table = $this->_sm->listTableDetails("drop_primary_key");
$this->assertFalse($table->hasPrimaryKey()); self::assertFalse($table->hasPrimaryKey());
$this->assertFalse($table->getColumn('id')->getAutoincrement()); self::assertFalse($table->getColumn('id')->getAutoincrement());
} }
/** /**
...@@ -165,12 +165,12 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -165,12 +165,12 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$onlineTable = $this->_sm->listTableDetails("text_blob_default_value"); $onlineTable = $this->_sm->listTableDetails("text_blob_default_value");
$this->assertNull($onlineTable->getColumn('def_text')->getDefault()); self::assertNull($onlineTable->getColumn('def_text')->getDefault());
$this->assertNull($onlineTable->getColumn('def_text_null')->getDefault()); self::assertNull($onlineTable->getColumn('def_text_null')->getDefault());
$this->assertFalse($onlineTable->getColumn('def_text_null')->getNotnull()); self::assertFalse($onlineTable->getColumn('def_text_null')->getNotnull());
$this->assertNull($onlineTable->getColumn('def_blob')->getDefault()); self::assertNull($onlineTable->getColumn('def_blob')->getDefault());
$this->assertNull($onlineTable->getColumn('def_blob_null')->getDefault()); self::assertNull($onlineTable->getColumn('def_blob_null')->getDefault());
$this->assertFalse($onlineTable->getColumn('def_blob_null')->getNotnull()); self::assertFalse($onlineTable->getColumn('def_blob_null')->getNotnull());
$comparator = new Comparator(); $comparator = new Comparator();
...@@ -178,12 +178,12 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -178,12 +178,12 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$onlineTable = $this->_sm->listTableDetails("text_blob_default_value"); $onlineTable = $this->_sm->listTableDetails("text_blob_default_value");
$this->assertNull($onlineTable->getColumn('def_text')->getDefault()); self::assertNull($onlineTable->getColumn('def_text')->getDefault());
$this->assertNull($onlineTable->getColumn('def_text_null')->getDefault()); self::assertNull($onlineTable->getColumn('def_text_null')->getDefault());
$this->assertFalse($onlineTable->getColumn('def_text_null')->getNotnull()); self::assertFalse($onlineTable->getColumn('def_text_null')->getNotnull());
$this->assertNull($onlineTable->getColumn('def_blob')->getDefault()); self::assertNull($onlineTable->getColumn('def_blob')->getDefault());
$this->assertNull($onlineTable->getColumn('def_blob_null')->getDefault()); self::assertNull($onlineTable->getColumn('def_blob_null')->getDefault());
$this->assertFalse($onlineTable->getColumn('def_blob_null')->getNotnull()); self::assertFalse($onlineTable->getColumn('def_blob_null')->getNotnull());
} }
public function testColumnCollation() public function testColumnCollation()
...@@ -199,10 +199,10 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -199,10 +199,10 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$columns = $this->_sm->listTableColumns('test_collation'); $columns = $this->_sm->listTableColumns('test_collation');
$this->assertArrayNotHasKey('collation', $columns['id']->getPlatformOptions()); self::assertArrayNotHasKey('collation', $columns['id']->getPlatformOptions());
$this->assertEquals('latin1_swedish_ci', $columns['text']->getPlatformOption('collation')); self::assertEquals('latin1_swedish_ci', $columns['text']->getPlatformOption('collation'));
$this->assertEquals('latin1_swedish_ci', $columns['foo']->getPlatformOption('collation')); self::assertEquals('latin1_swedish_ci', $columns['foo']->getPlatformOption('collation'));
$this->assertEquals('utf8_general_ci', $columns['bar']->getPlatformOption('collation')); self::assertEquals('utf8_general_ci', $columns['bar']->getPlatformOption('collation'));
} }
/** /**
...@@ -229,36 +229,36 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -229,36 +229,36 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$offlineColumns = $table->getColumns(); $offlineColumns = $table->getColumns();
$onlineColumns = $this->_sm->listTableColumns($tableName); $onlineColumns = $this->_sm->listTableColumns($tableName);
$this->assertSame( self::assertSame(
$platform->getClobTypeDeclarationSQL($offlineColumns['col_tinytext']->toArray()), $platform->getClobTypeDeclarationSQL($offlineColumns['col_tinytext']->toArray()),
$platform->getClobTypeDeclarationSQL($onlineColumns['col_tinytext']->toArray()) $platform->getClobTypeDeclarationSQL($onlineColumns['col_tinytext']->toArray())
); );
$this->assertSame( self::assertSame(
$platform->getClobTypeDeclarationSQL($offlineColumns['col_text']->toArray()), $platform->getClobTypeDeclarationSQL($offlineColumns['col_text']->toArray()),
$platform->getClobTypeDeclarationSQL($onlineColumns['col_text']->toArray()) $platform->getClobTypeDeclarationSQL($onlineColumns['col_text']->toArray())
); );
$this->assertSame( self::assertSame(
$platform->getClobTypeDeclarationSQL($offlineColumns['col_mediumtext']->toArray()), $platform->getClobTypeDeclarationSQL($offlineColumns['col_mediumtext']->toArray()),
$platform->getClobTypeDeclarationSQL($onlineColumns['col_mediumtext']->toArray()) $platform->getClobTypeDeclarationSQL($onlineColumns['col_mediumtext']->toArray())
); );
$this->assertSame( self::assertSame(
$platform->getClobTypeDeclarationSQL($offlineColumns['col_longtext']->toArray()), $platform->getClobTypeDeclarationSQL($offlineColumns['col_longtext']->toArray()),
$platform->getClobTypeDeclarationSQL($onlineColumns['col_longtext']->toArray()) $platform->getClobTypeDeclarationSQL($onlineColumns['col_longtext']->toArray())
); );
$this->assertSame( self::assertSame(
$platform->getBlobTypeDeclarationSQL($offlineColumns['col_tinyblob']->toArray()), $platform->getBlobTypeDeclarationSQL($offlineColumns['col_tinyblob']->toArray()),
$platform->getBlobTypeDeclarationSQL($onlineColumns['col_tinyblob']->toArray()) $platform->getBlobTypeDeclarationSQL($onlineColumns['col_tinyblob']->toArray())
); );
$this->assertSame( self::assertSame(
$platform->getBlobTypeDeclarationSQL($offlineColumns['col_blob']->toArray()), $platform->getBlobTypeDeclarationSQL($offlineColumns['col_blob']->toArray()),
$platform->getBlobTypeDeclarationSQL($onlineColumns['col_blob']->toArray()) $platform->getBlobTypeDeclarationSQL($onlineColumns['col_blob']->toArray())
); );
$this->assertSame( self::assertSame(
$platform->getBlobTypeDeclarationSQL($offlineColumns['col_mediumblob']->toArray()), $platform->getBlobTypeDeclarationSQL($offlineColumns['col_mediumblob']->toArray()),
$platform->getBlobTypeDeclarationSQL($onlineColumns['col_mediumblob']->toArray()) $platform->getBlobTypeDeclarationSQL($onlineColumns['col_mediumblob']->toArray())
); );
$this->assertSame( self::assertSame(
$platform->getBlobTypeDeclarationSQL($offlineColumns['col_longblob']->toArray()), $platform->getBlobTypeDeclarationSQL($offlineColumns['col_longblob']->toArray()),
$platform->getBlobTypeDeclarationSQL($onlineColumns['col_longblob']->toArray()) $platform->getBlobTypeDeclarationSQL($onlineColumns['col_longblob']->toArray())
); );
...@@ -278,7 +278,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -278,7 +278,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$comparator = new Comparator(); $comparator = new Comparator();
$this->assertFalse( self::assertFalse(
$comparator->diffTable($offlineTable, $onlineTable), $comparator->diffTable($offlineTable, $onlineTable),
"No differences should be detected with the offline vs online schema." "No differences should be detected with the offline vs online schema."
); );
...@@ -299,10 +299,10 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -299,10 +299,10 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$columns = $this->_sm->listTableColumns($tableName); $columns = $this->_sm->listTableColumns($tableName);
$this->assertArrayHasKey('col', $columns); self::assertArrayHasKey('col', $columns);
$this->assertArrayHasKey('col_unsigned', $columns); self::assertArrayHasKey('col_unsigned', $columns);
$this->assertFalse($columns['col']->getUnsigned()); self::assertFalse($columns['col']->getUnsigned());
$this->assertTrue($columns['col_unsigned']->getUnsigned()); self::assertTrue($columns['col_unsigned']->getUnsigned());
} }
/** /**
...@@ -320,9 +320,9 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -320,9 +320,9 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$columns = $this->_sm->listTableColumns($tableName); $columns = $this->_sm->listTableColumns($tableName);
$this->assertArrayHasKey('col', $columns); self::assertArrayHasKey('col', $columns);
$this->assertArrayHasKey('col_unsigned', $columns); self::assertArrayHasKey('col_unsigned', $columns);
$this->assertFalse($columns['col']->getUnsigned()); self::assertFalse($columns['col']->getUnsigned());
$this->assertTrue($columns['col_unsigned']->getUnsigned()); self::assertTrue($columns['col_unsigned']->getUnsigned());
} }
} }
...@@ -21,10 +21,10 @@ class SQLAnywhereSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -21,10 +21,10 @@ class SQLAnywhereSchemaManagerTest extends SchemaManagerFunctionalTestCase
$views = $this->_sm->listViews(); $views = $this->_sm->listViews();
$this->assertEquals(1, count($views), "Database has to have one view."); self::assertEquals(1, count($views), "Database has to have one view.");
$this->assertInstanceOf('Doctrine\DBAL\Schema\View', $views[$name]); self::assertInstanceOf('Doctrine\DBAL\Schema\View', $views[$name]);
$this->assertEquals($name, $views[$name]->getName()); self::assertEquals($name, $views[$name]->getName());
$this->assertEquals($sql, $views[$name]->getSql()); self::assertEquals($sql, $views[$name]->getSql());
} }
public function testDropAndCreateAdvancedIndex() public function testDropAndCreateAdvancedIndex()
...@@ -37,14 +37,14 @@ class SQLAnywhereSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -37,14 +37,14 @@ class SQLAnywhereSchemaManagerTest extends SchemaManagerFunctionalTestCase
); );
$tableIndexes = $this->_sm->listTableIndexes('test_create_advanced_index'); $tableIndexes = $this->_sm->listTableIndexes('test_create_advanced_index');
$this->assertInternalType('array', $tableIndexes); self::assertInternalType('array', $tableIndexes);
$this->assertEquals('test', $tableIndexes['test']->getName()); self::assertEquals('test', $tableIndexes['test']->getName());
$this->assertEquals(array('test'), $tableIndexes['test']->getColumns()); self::assertEquals(array('test'), $tableIndexes['test']->getColumns());
$this->assertTrue($tableIndexes['test']->isUnique()); self::assertTrue($tableIndexes['test']->isUnique());
$this->assertFalse($tableIndexes['test']->isPrimary()); self::assertFalse($tableIndexes['test']->isPrimary());
$this->assertTrue($tableIndexes['test']->hasFlag('clustered')); self::assertTrue($tableIndexes['test']->hasFlag('clustered'));
$this->assertTrue($tableIndexes['test']->hasFlag('with_nulls_not_distinct')); self::assertTrue($tableIndexes['test']->hasFlag('with_nulls_not_distinct'));
$this->assertTrue($tableIndexes['test']->hasFlag('for_olap_workload')); self::assertTrue($tableIndexes['test']->hasFlag('for_olap_workload'));
} }
public function testListTableColumnsWithFixedStringTypeColumn() public function testListTableColumnsWithFixedStringTypeColumn()
...@@ -58,7 +58,7 @@ class SQLAnywhereSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -58,7 +58,7 @@ class SQLAnywhereSchemaManagerTest extends SchemaManagerFunctionalTestCase
$columns = $this->_sm->listTableColumns('list_table_columns_char'); $columns = $this->_sm->listTableColumns('list_table_columns_char');
$this->assertArrayHasKey('test', $columns); self::assertArrayHasKey('test', $columns);
$this->assertTrue($columns['test']->getFixed()); self::assertTrue($columns['test']->getFixed());
} }
} }
...@@ -22,9 +22,9 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -22,9 +22,9 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase
$path = dirname(__FILE__).'/test_create_and_drop_sqlite_database.sqlite'; $path = dirname(__FILE__).'/test_create_and_drop_sqlite_database.sqlite';
$this->_sm->createDatabase($path); $this->_sm->createDatabase($path);
$this->assertEquals(true, file_exists($path)); self::assertEquals(true, file_exists($path));
$this->_sm->dropDatabase($path); $this->_sm->dropDatabase($path);
$this->assertEquals(false, file_exists($path)); self::assertEquals(false, file_exists($path));
} }
/** /**
...@@ -34,7 +34,7 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -34,7 +34,7 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase
{ {
$this->_sm->dropAndCreateDatabase('test_drop_database'); $this->_sm->dropAndCreateDatabase('test_drop_database');
$this->assertFileExists('test_drop_database'); self::assertFileExists('test_drop_database');
$params = $this->_conn->getParams(); $params = $this->_conn->getParams();
$params['dbname'] = 'test_drop_database'; $params['dbname'] = 'test_drop_database';
...@@ -44,11 +44,11 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -44,11 +44,11 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase
$connection = $this->_conn->getDriver()->connect($params, $user, $password); $connection = $this->_conn->getDriver()->connect($params, $user, $password);
$this->assertInstanceOf('Doctrine\DBAL\Driver\Connection', $connection); self::assertInstanceOf('Doctrine\DBAL\Driver\Connection', $connection);
$this->_sm->dropDatabase('test_drop_database'); $this->_sm->dropDatabase('test_drop_database');
$this->assertFileNotExists('test_drop_database'); self::assertFileNotExists('test_drop_database');
unset($connection); unset($connection);
} }
...@@ -59,8 +59,8 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -59,8 +59,8 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase
$this->_sm->renameTable('oldname', 'newname'); $this->_sm->renameTable('oldname', 'newname');
$tables = $this->_sm->listTableNames(); $tables = $this->_sm->listTableNames();
$this->assertContains('newname', $tables); self::assertContains('newname', $tables);
$this->assertNotContains('oldname', $tables); self::assertNotContains('oldname', $tables);
} }
public function createListTableColumns() public function createListTableColumns()
...@@ -93,7 +93,7 @@ EOS ...@@ -93,7 +93,7 @@ EOS
array('onUpdate' => 'NO ACTION', 'onDelete' => 'NO ACTION', 'deferrable' => true, 'deferred' => true)), array('onUpdate' => 'NO ACTION', 'onDelete' => 'NO ACTION', 'deferrable' => true, 'deferred' => true)),
); );
$this->assertEquals($expected, $this->_sm->listTableForeignKeys('user')); self::assertEquals($expected, $this->_sm->listTableForeignKeys('user'));
} }
public function testColumnCollation() public function testColumnCollation()
...@@ -107,10 +107,10 @@ EOS ...@@ -107,10 +107,10 @@ EOS
$columns = $this->_sm->listTableColumns('test_collation'); $columns = $this->_sm->listTableColumns('test_collation');
$this->assertArrayNotHasKey('collation', $columns['id']->getPlatformOptions()); self::assertArrayNotHasKey('collation', $columns['id']->getPlatformOptions());
$this->assertEquals('BINARY', $columns['text']->getPlatformOption('collation')); self::assertEquals('BINARY', $columns['text']->getPlatformOption('collation'));
$this->assertEquals('BINARY', $columns['foo']->getPlatformOption('collation')); self::assertEquals('BINARY', $columns['foo']->getPlatformOption('collation'));
$this->assertEquals('NOCASE', $columns['bar']->getPlatformOption('collation')); self::assertEquals('NOCASE', $columns['bar']->getPlatformOption('collation'));
} }
public function testListTableWithBinary() public function testListTableWithBinary()
...@@ -127,11 +127,11 @@ EOS ...@@ -127,11 +127,11 @@ EOS
$table = $this->_sm->listTableDetails($tableName); $table = $this->_sm->listTableDetails($tableName);
$this->assertInstanceOf('Doctrine\DBAL\Types\BlobType', $table->getColumn('column_varbinary')->getType()); self::assertInstanceOf('Doctrine\DBAL\Types\BlobType', $table->getColumn('column_varbinary')->getType());
$this->assertFalse($table->getColumn('column_varbinary')->getFixed()); self::assertFalse($table->getColumn('column_varbinary')->getFixed());
$this->assertInstanceOf('Doctrine\DBAL\Types\BlobType', $table->getColumn('column_binary')->getType()); self::assertInstanceOf('Doctrine\DBAL\Types\BlobType', $table->getColumn('column_binary')->getType());
$this->assertFalse($table->getColumn('column_binary')->getFixed()); self::assertFalse($table->getColumn('column_binary')->getFixed());
} }
public function testNonDefaultPKOrder() public function testNonDefaultPKOrder()
...@@ -155,10 +155,10 @@ EOS ...@@ -155,10 +155,10 @@ EOS
$tableIndexes = $this->_sm->listTableIndexes('non_default_pk_order'); $tableIndexes = $this->_sm->listTableIndexes('non_default_pk_order');
$this->assertEquals(1, count($tableIndexes)); self::assertEquals(1, count($tableIndexes));
$this->assertArrayHasKey('primary', $tableIndexes, 'listTableIndexes() has to return a "primary" array key.'); self::assertArrayHasKey('primary', $tableIndexes, 'listTableIndexes() has to return a "primary" array key.');
$this->assertEquals(array('other_id', 'id'), array_map('strtolower', $tableIndexes['primary']->getColumns())); self::assertEquals(array('other_id', 'id'), array_map('strtolower', $tableIndexes['primary']->getColumns()));
} }
/** /**
...@@ -177,16 +177,16 @@ SQL; ...@@ -177,16 +177,16 @@ SQL;
$columns = $this->_sm->listTableColumns('dbal_1779'); $columns = $this->_sm->listTableColumns('dbal_1779');
$this->assertCount(2, $columns); self::assertCount(2, $columns);
$this->assertArrayHasKey('foo', $columns); self::assertArrayHasKey('foo', $columns);
$this->assertArrayHasKey('bar', $columns); self::assertArrayHasKey('bar', $columns);
$this->assertSame(Type::getType(Type::STRING), $columns['foo']->getType()); self::assertSame(Type::getType(Type::STRING), $columns['foo']->getType());
$this->assertSame(Type::getType(Type::TEXT), $columns['bar']->getType()); self::assertSame(Type::getType(Type::TEXT), $columns['bar']->getType());
$this->assertSame(64, $columns['foo']->getLength()); self::assertSame(64, $columns['foo']->getLength());
$this->assertSame(100, $columns['bar']->getLength()); self::assertSame(100, $columns['bar']->getLength());
} }
/** /**
...@@ -208,9 +208,9 @@ SQL; ...@@ -208,9 +208,9 @@ SQL;
$diff = $comparator->diffTable($offlineTable, $onlineTable); $diff = $comparator->diffTable($offlineTable, $onlineTable);
if ($expectedComparatorDiff) { if ($expectedComparatorDiff) {
$this->assertEmpty($this->_sm->getDatabasePlatform()->getAlterTableSQL($diff)); self::assertEmpty($this->_sm->getDatabasePlatform()->getAlterTableSQL($diff));
} else { } else {
$this->assertFalse($diff); self::assertFalse($diff);
} }
} }
......
...@@ -28,15 +28,15 @@ class StatementTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -28,15 +28,15 @@ class StatementTest extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt->execute(); $stmt->execute();
$id = $stmt->fetchColumn(); $id = $stmt->fetchColumn();
$this->assertEquals(1, $id); self::assertEquals(1, $id);
$stmt->closeCursor(); $stmt->closeCursor();
$stmt->execute(); $stmt->execute();
$id = $stmt->fetchColumn(); $id = $stmt->fetchColumn();
$this->assertEquals(1, $id); self::assertEquals(1, $id);
$id = $stmt->fetchColumn(); $id = $stmt->fetchColumn();
$this->assertEquals(2, $id); self::assertEquals(2, $id);
} }
public function testReuseStatementWithLongerResults() public function testReuseStatementWithLongerResults()
...@@ -55,7 +55,7 @@ class StatementTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -55,7 +55,7 @@ class StatementTest extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt = $this->_conn->prepare('SELECT param, val FROM stmt_longer_results ORDER BY param'); $stmt = $this->_conn->prepare('SELECT param, val FROM stmt_longer_results ORDER BY param');
$stmt->execute(); $stmt->execute();
$this->assertArraySubset(array( self::assertArraySubset(array(
array('param1', 'X'), array('param1', 'X'),
), $stmt->fetchAll(\PDO::FETCH_NUM)); ), $stmt->fetchAll(\PDO::FETCH_NUM));
...@@ -66,7 +66,7 @@ class StatementTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -66,7 +66,7 @@ class StatementTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->insert('stmt_longer_results', $row2); $this->_conn->insert('stmt_longer_results', $row2);
$stmt->execute(); $stmt->execute();
$this->assertArraySubset(array( self::assertArraySubset(array(
array('param1', 'X'), array('param1', 'X'),
array('param2', 'A bit longer value'), array('param2', 'A bit longer value'),
), $stmt->fetchAll(\PDO::FETCH_NUM)); ), $stmt->fetchAll(\PDO::FETCH_NUM));
...@@ -119,7 +119,7 @@ EOF ...@@ -119,7 +119,7 @@ EOF
$this->markTestSkipped('Skipping on pdo_sqlsrv due to https://github.com/Microsoft/msphpsql/issues/270'); $this->markTestSkipped('Skipping on pdo_sqlsrv due to https://github.com/Microsoft/msphpsql/issues/270');
} }
$this->assertSame($contents, stream_get_contents($stream)); self::assertSame($contents, stream_get_contents($stream));
} }
public function testIncompletelyFetchedStatementDoesNotBlockConnection() public function testIncompletelyFetchedStatementDoesNotBlockConnection()
...@@ -136,7 +136,7 @@ EOF ...@@ -136,7 +136,7 @@ EOF
$stmt2 = $this->_conn->prepare('SELECT id FROM stmt_test WHERE id = ?'); $stmt2 = $this->_conn->prepare('SELECT id FROM stmt_test WHERE id = ?');
$stmt2->execute(array(1)); $stmt2->execute(array(1));
$this->assertEquals(1, $stmt2->fetchColumn()); self::assertEquals(1, $stmt2->fetchColumn());
} }
public function testReuseStatementAfterClosingCursor() public function testReuseStatementAfterClosingCursor()
...@@ -148,13 +148,13 @@ EOF ...@@ -148,13 +148,13 @@ EOF
$stmt->execute(array(1)); $stmt->execute(array(1));
$id = $stmt->fetchColumn(); $id = $stmt->fetchColumn();
$this->assertEquals(1, $id); self::assertEquals(1, $id);
$stmt->closeCursor(); $stmt->closeCursor();
$stmt->execute(array(2)); $stmt->execute(array(2));
$id = $stmt->fetchColumn(); $id = $stmt->fetchColumn();
$this->assertEquals(2, $id); self::assertEquals(2, $id);
} }
public function testReuseStatementWithParameterBoundByReference() public function testReuseStatementWithParameterBoundByReference()
...@@ -167,11 +167,11 @@ EOF ...@@ -167,11 +167,11 @@ EOF
$id = 1; $id = 1;
$stmt->execute(); $stmt->execute();
$this->assertEquals(1, $stmt->fetchColumn()); self::assertEquals(1, $stmt->fetchColumn());
$id = 2; $id = 2;
$stmt->execute(); $stmt->execute();
$this->assertEquals(2, $stmt->fetchColumn()); self::assertEquals(2, $stmt->fetchColumn());
} }
public function testReuseStatementWithReboundValue() public function testReuseStatementWithReboundValue()
...@@ -183,11 +183,11 @@ EOF ...@@ -183,11 +183,11 @@ EOF
$stmt->bindValue(1, 1); $stmt->bindValue(1, 1);
$stmt->execute(); $stmt->execute();
$this->assertEquals(1, $stmt->fetchColumn()); self::assertEquals(1, $stmt->fetchColumn());
$stmt->bindValue(1, 2); $stmt->bindValue(1, 2);
$stmt->execute(); $stmt->execute();
$this->assertEquals(2, $stmt->fetchColumn()); self::assertEquals(2, $stmt->fetchColumn());
} }
public function testReuseStatementWithReboundParam() public function testReuseStatementWithReboundParam()
...@@ -200,12 +200,12 @@ EOF ...@@ -200,12 +200,12 @@ EOF
$x = 1; $x = 1;
$stmt->bindParam(1, $x); $stmt->bindParam(1, $x);
$stmt->execute(); $stmt->execute();
$this->assertEquals(1, $stmt->fetchColumn()); self::assertEquals(1, $stmt->fetchColumn());
$y = 2; $y = 2;
$stmt->bindParam(1, $y); $stmt->bindParam(1, $y);
$stmt->execute(); $stmt->execute();
$this->assertEquals(2, $stmt->fetchColumn()); self::assertEquals(2, $stmt->fetchColumn());
} }
/** /**
...@@ -215,14 +215,14 @@ EOF ...@@ -215,14 +215,14 @@ EOF
{ {
$stmt = $this->_conn->prepare('SELECT id FROM stmt_test'); $stmt = $this->_conn->prepare('SELECT id FROM stmt_test');
$this->assertSame($expected, $fetch($stmt)); self::assertSame($expected, $fetch($stmt));
} }
public function testCloseCursorOnNonExecutedStatement() public function testCloseCursorOnNonExecutedStatement()
{ {
$stmt = $this->_conn->prepare('SELECT id FROM stmt_test'); $stmt = $this->_conn->prepare('SELECT id FROM stmt_test');
$this->assertTrue($stmt->closeCursor()); self::assertTrue($stmt->closeCursor());
} }
/** /**
...@@ -235,7 +235,7 @@ EOF ...@@ -235,7 +235,7 @@ EOF
$stmt->execute(); $stmt->execute();
$stmt->fetch(); $stmt->fetch();
$this->assertTrue($stmt->closeCursor()); self::assertTrue($stmt->closeCursor());
} }
/** /**
...@@ -246,7 +246,7 @@ EOF ...@@ -246,7 +246,7 @@ EOF
$stmt = $this->_conn->prepare('SELECT id FROM stmt_test'); $stmt = $this->_conn->prepare('SELECT id FROM stmt_test');
$stmt->closeCursor(); $stmt->closeCursor();
$this->assertSame($expected, $fetch($stmt)); self::assertSame($expected, $fetch($stmt));
} }
/** /**
...@@ -260,7 +260,7 @@ EOF ...@@ -260,7 +260,7 @@ EOF
$stmt->execute(); $stmt->execute();
$stmt->closeCursor(); $stmt->closeCursor();
$this->assertSame($expected, $fetch($stmt)); self::assertSame($expected, $fetch($stmt));
} }
public static function emptyFetchProvider() public static function emptyFetchProvider()
......
...@@ -40,9 +40,9 @@ class TableGeneratorTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -40,9 +40,9 @@ class TableGeneratorTest extends \Doctrine\Tests\DbalFunctionalTestCase
$id2 = $this->generator->nextValue("tbl1"); $id2 = $this->generator->nextValue("tbl1");
$id3 = $this->generator->nextValue("tbl2"); $id3 = $this->generator->nextValue("tbl2");
$this->assertTrue($id1 > 0, "First id has to be larger than 0"); self::assertTrue($id1 > 0, "First id has to be larger than 0");
$this->assertEquals($id1 + 1, $id2, "Second id is one larger than first one."); self::assertEquals($id1 + 1, $id2, "Second id is one larger than first one.");
$this->assertEquals($id1, $id3, "First ids from different tables are equal."); self::assertEquals($id1, $id3, "First ids from different tables are equal.");
} }
public function testNextValNotAffectedByOuterTransactions() public function testNextValNotAffectedByOuterTransactions()
...@@ -52,8 +52,8 @@ class TableGeneratorTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -52,8 +52,8 @@ class TableGeneratorTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->rollBack(); $this->_conn->rollBack();
$id2 = $this->generator->nextValue("tbl1"); $id2 = $this->generator->nextValue("tbl1");
$this->assertTrue($id1 > 0, "First id has to be larger than 0"); self::assertTrue($id1 > 0, "First id has to be larger than 0");
$this->assertEquals($id1 + 1, $id2, "Second id is one larger than first one."); self::assertEquals($id1 + 1, $id2, "Second id is one larger than first one.");
} }
} }
...@@ -62,7 +62,7 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -62,7 +62,7 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->rollBack(); $this->_conn->rollBack();
$rows = $this->_conn->fetchAll('SELECT * FROM nontemporary'); $rows = $this->_conn->fetchAll('SELECT * FROM nontemporary');
$this->assertEquals(array(), $rows, "In an event of an error this result has one row, because of an implicit commit."); self::assertEquals(array(), $rows, "In an event of an error this result has one row, because of an implicit commit.");
} }
/** /**
...@@ -104,6 +104,6 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -104,6 +104,6 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
} }
$rows = $this->_conn->fetchAll('SELECT * FROM nontemporary'); $rows = $this->_conn->fetchAll('SELECT * FROM nontemporary');
$this->assertEquals(array(), $rows, "In an event of an error this result has one row, because of an implicit commit."); self::assertEquals(array(), $rows, "In an event of an error this result has one row, because of an implicit commit.");
} }
} }
...@@ -22,6 +22,6 @@ class DBAL168Test extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -22,6 +22,6 @@ class DBAL168Test extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->getSchemaManager()->createTable($table); $this->_conn->getSchemaManager()->createTable($table);
$table = $this->_conn->getSchemaManager()->listTableDetails('domains'); $table = $this->_conn->getSchemaManager()->listTableDetails('domains');
$this->assertEquals('domains', $table->getName()); self::assertEquals('domains', $table->getName());
} }
} }
\ No newline at end of file
...@@ -33,7 +33,7 @@ class DBAL202Test extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -33,7 +33,7 @@ class DBAL202Test extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt->execute(); $stmt->execute();
$this->_conn->rollBack(); $this->_conn->rollBack();
$this->assertEquals(0, $this->_conn->query('SELECT COUNT(1) FROM DBAL202')->fetchColumn()); self::assertEquals(0, $this->_conn->query('SELECT COUNT(1) FROM DBAL202')->fetchColumn());
} }
public function testStatementCommit() public function testStatementCommit()
...@@ -43,6 +43,6 @@ class DBAL202Test extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -43,6 +43,6 @@ class DBAL202Test extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt->execute(); $stmt->execute();
$this->_conn->commit(); $this->_conn->commit();
$this->assertEquals(1, $this->_conn->query('SELECT COUNT(1) FROM DBAL202')->fetchColumn()); self::assertEquals(1, $this->_conn->query('SELECT COUNT(1) FROM DBAL202')->fetchColumn());
} }
} }
...@@ -21,7 +21,7 @@ class DBAL421Test extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -21,7 +21,7 @@ class DBAL421Test extends \Doctrine\Tests\DbalFunctionalTestCase
{ {
$guid = $this->_conn->query($this->getSelectGuidSql())->fetchColumn(); $guid = $this->_conn->query($this->getSelectGuidSql())->fetchColumn();
$pattern = '/[0-9A-F]{8}\-[0-9A-F]{4}\-[0-9A-F]{4}\-[8-9A-B][0-9A-F]{3}\-[0-9A-F]{12}/i'; $pattern = '/[0-9A-F]{8}\-[0-9A-F]{4}\-[0-9A-F]{4}\-[8-9A-B][0-9A-F]{3}\-[0-9A-F]{12}/i';
$this->assertEquals(1, preg_match($pattern, $guid), "GUID does not match pattern"); self::assertEquals(1, preg_match($pattern, $guid), "GUID does not match pattern");
} }
/** /**
...@@ -36,7 +36,7 @@ class DBAL421Test extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -36,7 +36,7 @@ class DBAL421Test extends \Doctrine\Tests\DbalFunctionalTestCase
for ($i = 0; $i < 99; $i++) { for ($i = 0; $i < 99; $i++) {
$statement->execute(); $statement->execute();
$guid = $statement->fetchColumn(); $guid = $statement->fetchColumn();
$this->assertNotContains($guid, $guids, "Duplicate GUID detected"); self::assertNotContains($guid, $guids, "Duplicate GUID detected");
$guids[] = $guid; $guids[] = $guid;
} }
......
...@@ -31,6 +31,6 @@ class DBAL461Test extends \PHPUnit\Framework\TestCase ...@@ -31,6 +31,6 @@ class DBAL461Test extends \PHPUnit\Framework\TestCase
'comment' => null, 'comment' => null,
)); ));
$this->assertEquals('Decimal', (string)$column->getType()); self::assertEquals('Decimal', (string)$column->getType());
} }
} }
...@@ -32,6 +32,6 @@ class DBAL510Test extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -32,6 +32,6 @@ class DBAL510Test extends \Doctrine\Tests\DbalFunctionalTestCase
$comparator = new Comparator(); $comparator = new Comparator();
$diff = $comparator->diffTable($onlineTable, $table); $diff = $comparator->diffTable($onlineTable, $table);
$this->assertFalse($diff); self::assertFalse($diff);
} }
} }
...@@ -49,22 +49,22 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -49,22 +49,22 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
{ {
$this->_conn->executeUpdate('INSERT INTO dbal630 (bool_col) VALUES(false)'); $this->_conn->executeUpdate('INSERT INTO dbal630 (bool_col) VALUES(false)');
$id = $this->_conn->lastInsertId('dbal630_id_seq'); $id = $this->_conn->lastInsertId('dbal630_id_seq');
$this->assertNotEmpty($id); self::assertNotEmpty($id);
$row = $this->_conn->fetchAssoc('SELECT bool_col FROM dbal630 WHERE id = ?', array($id)); $row = $this->_conn->fetchAssoc('SELECT bool_col FROM dbal630 WHERE id = ?', array($id));
$this->assertFalse($row['bool_col']); self::assertFalse($row['bool_col']);
} }
public function testBooleanConversionBoolParamRealPrepares() public function testBooleanConversionBoolParamRealPrepares()
{ {
$this->_conn->executeUpdate('INSERT INTO dbal630 (bool_col) VALUES(?)', array('false'), array(PDO::PARAM_BOOL)); $this->_conn->executeUpdate('INSERT INTO dbal630 (bool_col) VALUES(?)', array('false'), array(PDO::PARAM_BOOL));
$id = $this->_conn->lastInsertId('dbal630_id_seq'); $id = $this->_conn->lastInsertId('dbal630_id_seq');
$this->assertNotEmpty($id); self::assertNotEmpty($id);
$row = $this->_conn->fetchAssoc('SELECT bool_col FROM dbal630 WHERE id = ?', array($id)); $row = $this->_conn->fetchAssoc('SELECT bool_col FROM dbal630 WHERE id = ?', array($id));
$this->assertFalse($row['bool_col']); self::assertFalse($row['bool_col']);
} }
public function testBooleanConversionBoolParamEmulatedPrepares() public function testBooleanConversionBoolParamEmulatedPrepares()
...@@ -85,11 +85,11 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -85,11 +85,11 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
$id = $this->_conn->lastInsertId('dbal630_id_seq'); $id = $this->_conn->lastInsertId('dbal630_id_seq');
$this->assertNotEmpty($id); self::assertNotEmpty($id);
$row = $this->_conn->fetchAssoc('SELECT bool_col FROM dbal630 WHERE id = ?', array($id)); $row = $this->_conn->fetchAssoc('SELECT bool_col FROM dbal630 WHERE id = ?', array($id));
$this->assertFalse($row['bool_col']); self::assertFalse($row['bool_col']);
} }
/** /**
...@@ -115,11 +115,11 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -115,11 +115,11 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
$id = $this->_conn->lastInsertId('dbal630_allow_nulls_id_seq'); $id = $this->_conn->lastInsertId('dbal630_allow_nulls_id_seq');
$this->assertNotEmpty($id); self::assertNotEmpty($id);
$row = $this->_conn->fetchAssoc('SELECT bool_col FROM dbal630_allow_nulls WHERE id = ?', array($id)); $row = $this->_conn->fetchAssoc('SELECT bool_col FROM dbal630_allow_nulls WHERE id = ?', array($id));
$this->assertSame($databaseConvertedValue, $row['bool_col']); self::assertSame($databaseConvertedValue, $row['bool_col']);
} }
/** /**
...@@ -145,11 +145,11 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -145,11 +145,11 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
$id = $this->_conn->lastInsertId('dbal630_allow_nulls_id_seq'); $id = $this->_conn->lastInsertId('dbal630_allow_nulls_id_seq');
$this->assertNotEmpty($id); self::assertNotEmpty($id);
$row = $this->_conn->fetchAssoc('SELECT bool_col FROM dbal630_allow_nulls WHERE id = ?', array($id)); $row = $this->_conn->fetchAssoc('SELECT bool_col FROM dbal630_allow_nulls WHERE id = ?', array($id));
$this->assertSame($databaseConvertedValue, $row['bool_col']); self::assertSame($databaseConvertedValue, $row['bool_col']);
} }
/** /**
......
...@@ -38,23 +38,23 @@ SQL ...@@ -38,23 +38,23 @@ SQL
$fetchedTable = $schemaManager->listTableDetails('dbal752_unsigneds'); $fetchedTable = $schemaManager->listTableDetails('dbal752_unsigneds');
$this->assertEquals('smallint', $fetchedTable->getColumn('small')->getType()->getName()); self::assertEquals('smallint', $fetchedTable->getColumn('small')->getType()->getName());
$this->assertEquals('smallint', $fetchedTable->getColumn('small_unsigned')->getType()->getName()); self::assertEquals('smallint', $fetchedTable->getColumn('small_unsigned')->getType()->getName());
$this->assertEquals('integer', $fetchedTable->getColumn('medium')->getType()->getName()); self::assertEquals('integer', $fetchedTable->getColumn('medium')->getType()->getName());
$this->assertEquals('integer', $fetchedTable->getColumn('medium_unsigned')->getType()->getName()); self::assertEquals('integer', $fetchedTable->getColumn('medium_unsigned')->getType()->getName());
$this->assertEquals('integer', $fetchedTable->getColumn('integer')->getType()->getName()); self::assertEquals('integer', $fetchedTable->getColumn('integer')->getType()->getName());
$this->assertEquals('integer', $fetchedTable->getColumn('integer_unsigned')->getType()->getName()); self::assertEquals('integer', $fetchedTable->getColumn('integer_unsigned')->getType()->getName());
$this->assertEquals('bigint', $fetchedTable->getColumn('big')->getType()->getName()); self::assertEquals('bigint', $fetchedTable->getColumn('big')->getType()->getName());
$this->assertEquals('bigint', $fetchedTable->getColumn('big_unsigned')->getType()->getName()); self::assertEquals('bigint', $fetchedTable->getColumn('big_unsigned')->getType()->getName());
$this->assertTrue($fetchedTable->getColumn('small_unsigned')->getUnsigned()); self::assertTrue($fetchedTable->getColumn('small_unsigned')->getUnsigned());
$this->assertTrue($fetchedTable->getColumn('medium_unsigned')->getUnsigned()); self::assertTrue($fetchedTable->getColumn('medium_unsigned')->getUnsigned());
$this->assertTrue($fetchedTable->getColumn('integer_unsigned')->getUnsigned()); self::assertTrue($fetchedTable->getColumn('integer_unsigned')->getUnsigned());
$this->assertTrue($fetchedTable->getColumn('big_unsigned')->getUnsigned()); self::assertTrue($fetchedTable->getColumn('big_unsigned')->getUnsigned());
$this->assertFalse($fetchedTable->getColumn('small')->getUnsigned()); self::assertFalse($fetchedTable->getColumn('small')->getUnsigned());
$this->assertFalse($fetchedTable->getColumn('medium')->getUnsigned()); self::assertFalse($fetchedTable->getColumn('medium')->getUnsigned());
$this->assertFalse($fetchedTable->getColumn('integer')->getUnsigned()); self::assertFalse($fetchedTable->getColumn('integer')->getUnsigned());
$this->assertFalse($fetchedTable->getColumn('big')->getUnsigned()); self::assertFalse($fetchedTable->getColumn('big')->getUnsigned());
} }
} }
...@@ -83,16 +83,16 @@ class TypeConversionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -83,16 +83,16 @@ class TypeConversionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$actualDbValue = $typeInstance->convertToPHPValue($this->_conn->fetchColumn($sql), $this->_conn->getDatabasePlatform()); $actualDbValue = $typeInstance->convertToPHPValue($this->_conn->fetchColumn($sql), $this->_conn->getDatabasePlatform());
if ($originalValue instanceof \DateTime) { if ($originalValue instanceof \DateTime) {
$this->assertInstanceOf($expectedPhpType, $actualDbValue, "The expected type from the conversion to and back from the database should be " . $expectedPhpType); self::assertInstanceOf($expectedPhpType, $actualDbValue, "The expected type from the conversion to and back from the database should be " . $expectedPhpType);
} else { } else {
$this->assertInternalType($expectedPhpType, $actualDbValue, "The expected type from the conversion to and back from the database should be " . $expectedPhpType); self::assertInternalType($expectedPhpType, $actualDbValue, "The expected type from the conversion to and back from the database should be " . $expectedPhpType);
} }
if ($type !== "datetimetz") { if ($type !== "datetimetz") {
$this->assertEquals($originalValue, $actualDbValue, "Conversion between values should produce the same out as in value, but doesnt!"); self::assertEquals($originalValue, $actualDbValue, "Conversion between values should produce the same out as in value, but doesnt!");
if ($originalValue instanceof \DateTime) { if ($originalValue instanceof \DateTime) {
$this->assertEquals($originalValue->getTimezone()->getName(), $actualDbValue->getTimezone()->getName(), "Timezones should be the same."); self::assertEquals($originalValue->getTimezone()->getName(), $actualDbValue->getTimezone()->getName(), "Timezones should be the same.");
} }
} }
} }
......
...@@ -34,7 +34,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -34,7 +34,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->executeUpdate($sql, array("text", 1111), array(null, PDO::PARAM_INT)); $this->_conn->executeUpdate($sql, array("text", 1111), array(null, PDO::PARAM_INT));
$sql = "SELECT * FROM write_table WHERE test_string = ? AND test_int = ?"; $sql = "SELECT * FROM write_table WHERE test_string = ? AND test_int = ?";
$this->assertTrue((bool)$this->_conn->fetchColumn($sql, array("text", 1111))); self::assertTrue((bool)$this->_conn->fetchColumn($sql, array("text", 1111)));
} }
public function testExecuteUpdate() public function testExecuteUpdate()
...@@ -42,7 +42,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -42,7 +42,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$sql = "INSERT INTO write_table (test_int) VALUES ( " . $this->_conn->quote(1) . ")"; $sql = "INSERT INTO write_table (test_int) VALUES ( " . $this->_conn->quote(1) . ")";
$affected = $this->_conn->executeUpdate($sql); $affected = $this->_conn->executeUpdate($sql);
$this->assertEquals(1, $affected, "executeUpdate() should return the number of affected rows!"); self::assertEquals(1, $affected, "executeUpdate() should return the number of affected rows!");
} }
public function testExecuteUpdateWithTypes() public function testExecuteUpdateWithTypes()
...@@ -50,7 +50,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -50,7 +50,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$sql = "INSERT INTO write_table (test_int, test_string) VALUES (?, ?)"; $sql = "INSERT INTO write_table (test_int, test_string) VALUES (?, ?)";
$affected = $this->_conn->executeUpdate($sql, array(1, 'foo'), array(\PDO::PARAM_INT, \PDO::PARAM_STR)); $affected = $this->_conn->executeUpdate($sql, array(1, 'foo'), array(\PDO::PARAM_INT, \PDO::PARAM_STR));
$this->assertEquals(1, $affected, "executeUpdate() should return the number of affected rows!"); self::assertEquals(1, $affected, "executeUpdate() should return the number of affected rows!");
} }
public function testPrepareRowCountReturnsAffectedRows() public function testPrepareRowCountReturnsAffectedRows()
...@@ -62,7 +62,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -62,7 +62,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt->bindValue(2, "foo"); $stmt->bindValue(2, "foo");
$stmt->execute(); $stmt->execute();
$this->assertEquals(1, $stmt->rowCount()); self::assertEquals(1, $stmt->rowCount());
} }
public function testPrepareWithPdoTypes() public function testPrepareWithPdoTypes()
...@@ -74,7 +74,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -74,7 +74,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt->bindValue(2, "foo", \PDO::PARAM_STR); $stmt->bindValue(2, "foo", \PDO::PARAM_STR);
$stmt->execute(); $stmt->execute();
$this->assertEquals(1, $stmt->rowCount()); self::assertEquals(1, $stmt->rowCount());
} }
public function testPrepareWithDbalTypes() public function testPrepareWithDbalTypes()
...@@ -86,7 +86,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -86,7 +86,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt->bindValue(2, "foo", Type::getType('string')); $stmt->bindValue(2, "foo", Type::getType('string'));
$stmt->execute(); $stmt->execute();
$this->assertEquals(1, $stmt->rowCount()); self::assertEquals(1, $stmt->rowCount());
} }
public function testPrepareWithDbalTypeNames() public function testPrepareWithDbalTypeNames()
...@@ -98,13 +98,13 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -98,13 +98,13 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt->bindValue(2, "foo", 'string'); $stmt->bindValue(2, "foo", 'string');
$stmt->execute(); $stmt->execute();
$this->assertEquals(1, $stmt->rowCount()); self::assertEquals(1, $stmt->rowCount());
} }
public function insertRows() public function insertRows()
{ {
$this->assertEquals(1, $this->_conn->insert('write_table', array('test_int' => 1, 'test_string' => 'foo'))); self::assertEquals(1, $this->_conn->insert('write_table', array('test_int' => 1, 'test_string' => 'foo')));
$this->assertEquals(1, $this->_conn->insert('write_table', array('test_int' => 2, 'test_string' => 'bar'))); self::assertEquals(1, $this->_conn->insert('write_table', array('test_int' => 2, 'test_string' => 'bar')));
} }
public function testInsert() public function testInsert()
...@@ -116,20 +116,20 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -116,20 +116,20 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
{ {
$this->insertRows(); $this->insertRows();
$this->assertEquals(1, $this->_conn->delete('write_table', array('test_int' => 2))); self::assertEquals(1, $this->_conn->delete('write_table', array('test_int' => 2)));
$this->assertEquals(1, count($this->_conn->fetchAll('SELECT * FROM write_table'))); self::assertEquals(1, count($this->_conn->fetchAll('SELECT * FROM write_table')));
$this->assertEquals(1, $this->_conn->delete('write_table', array('test_int' => 1))); self::assertEquals(1, $this->_conn->delete('write_table', array('test_int' => 1)));
$this->assertEquals(0, count($this->_conn->fetchAll('SELECT * FROM write_table'))); self::assertEquals(0, count($this->_conn->fetchAll('SELECT * FROM write_table')));
} }
public function testUpdate() public function testUpdate()
{ {
$this->insertRows(); $this->insertRows();
$this->assertEquals(1, $this->_conn->update('write_table', array('test_string' => 'bar'), array('test_string' => 'foo'))); self::assertEquals(1, $this->_conn->update('write_table', array('test_string' => 'bar'), array('test_string' => 'foo')));
$this->assertEquals(2, $this->_conn->update('write_table', array('test_string' => 'baz'), array('test_string' => 'bar'))); self::assertEquals(2, $this->_conn->update('write_table', array('test_string' => 'baz'), array('test_string' => 'bar')));
$this->assertEquals(0, $this->_conn->update('write_table', array('test_string' => 'baz'), array('test_string' => 'bar'))); self::assertEquals(0, $this->_conn->update('write_table', array('test_string' => 'baz'), array('test_string' => 'bar')));
} }
public function testLastInsertId() public function testLastInsertId()
...@@ -138,11 +138,11 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -138,11 +138,11 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->markTestSkipped('Test only works on platforms with identity columns.'); $this->markTestSkipped('Test only works on platforms with identity columns.');
} }
$this->assertEquals(1, $this->_conn->insert('write_table', array('test_int' => 2, 'test_string' => 'bar'))); self::assertEquals(1, $this->_conn->insert('write_table', array('test_int' => 2, 'test_string' => 'bar')));
$num = $this->_conn->lastInsertId(); $num = $this->_conn->lastInsertId();
$this->assertNotNull($num, "LastInsertId() should not be null."); self::assertNotNull($num, "LastInsertId() should not be null.");
$this->assertTrue($num > 0, "LastInsertId() should be non-negative number."); self::assertTrue($num > 0, "LastInsertId() should be non-negative number.");
} }
public function testLastInsertIdSequence() public function testLastInsertIdSequence()
...@@ -158,7 +158,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -158,7 +158,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
} }
$sequences = $this->_conn->getSchemaManager()->listSequences(); $sequences = $this->_conn->getSchemaManager()->listSequences();
$this->assertEquals(1, count(array_filter($sequences, function($sequence) { self::assertEquals(1, count(array_filter($sequences, function($sequence) {
return strtolower($sequence->getName()) === 'write_table_id_seq'; return strtolower($sequence->getName()) === 'write_table_id_seq';
}))); })));
...@@ -167,8 +167,8 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -167,8 +167,8 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$lastInsertId = $this->_conn->lastInsertId('write_table_id_seq'); $lastInsertId = $this->_conn->lastInsertId('write_table_id_seq');
$this->assertTrue($lastInsertId > 0); self::assertTrue($lastInsertId > 0);
$this->assertEquals($nextSequenceVal, $lastInsertId); self::assertEquals($nextSequenceVal, $lastInsertId);
} }
public function testLastInsertIdNoSequenceGiven() public function testLastInsertIdNoSequenceGiven()
...@@ -177,7 +177,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -177,7 +177,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->markTestSkipped("Test only works consistently on platforms that support sequences and don't support identity columns."); $this->markTestSkipped("Test only works consistently on platforms that support sequences and don't support identity columns.");
} }
$this->assertFalse($this->_conn->lastInsertId( null )); self::assertFalse($this->_conn->lastInsertId( null ));
} }
...@@ -196,7 +196,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -196,7 +196,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$data = $this->_conn->fetchColumn('SELECT test_string FROM write_table WHERE test_int = 30'); $data = $this->_conn->fetchColumn('SELECT test_string FROM write_table WHERE test_int = 30');
$this->assertEquals($testString->format($this->_conn->getDatabasePlatform()->getDateTimeFormatString()), $data); self::assertEquals($testString->format($this->_conn->getDatabasePlatform()->getDateTimeFormatString()), $data);
} }
/** /**
...@@ -223,7 +223,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -223,7 +223,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$data = $this->_conn->fetchColumn('SELECT test_string FROM write_table WHERE test_int = 30'); $data = $this->_conn->fetchColumn('SELECT test_string FROM write_table WHERE test_int = 30');
$this->assertEquals($testString->format($this->_conn->getDatabasePlatform()->getDateTimeFormatString()), $data); self::assertEquals($testString->format($this->_conn->getDatabasePlatform()->getDateTimeFormatString()), $data);
} }
/** /**
...@@ -242,7 +242,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -242,7 +242,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$data = $this->_conn->fetchColumn('SELECT test_string FROM write_table WHERE test_int = 30'); $data = $this->_conn->fetchColumn('SELECT test_string FROM write_table WHERE test_int = 30');
$this->assertFalse($data); self::assertFalse($data);
} }
public function testEmptyIdentityInsert() public function testEmptyIdentityInsert()
...@@ -281,7 +281,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -281,7 +281,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$secondId = $this->_conn->lastInsertId($seqName); $secondId = $this->_conn->lastInsertId($seqName);
$this->assertTrue($secondId > $firstId); self::assertTrue($secondId > $firstId);
} }
...@@ -298,13 +298,13 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -298,13 +298,13 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$data = $this->_conn->fetchAll('SELECT * FROM write_table WHERE test_int = 30'); $data = $this->_conn->fetchAll('SELECT * FROM write_table WHERE test_int = 30');
$this->assertCount(1, $data); self::assertCount(1, $data);
$this->_conn->update('write_table', ['test_int' => 10], ['test_string' => null], ['test_string' => 'string', 'test_int' => 'integer']); $this->_conn->update('write_table', ['test_int' => 10], ['test_string' => null], ['test_string' => 'string', 'test_int' => 'integer']);
$data = $this->_conn->fetchAll('SELECT * FROM write_table WHERE test_int = 30'); $data = $this->_conn->fetchAll('SELECT * FROM write_table WHERE test_int = 30');
$this->assertCount(0, $data); self::assertCount(0, $data);
} }
public function testDeleteWhereIsNull() public function testDeleteWhereIsNull()
...@@ -317,12 +317,12 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -317,12 +317,12 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$data = $this->_conn->fetchAll('SELECT * FROM write_table WHERE test_int = 30'); $data = $this->_conn->fetchAll('SELECT * FROM write_table WHERE test_int = 30');
$this->assertCount(1, $data); self::assertCount(1, $data);
$this->_conn->delete('write_table', ['test_string' => null], ['test_string' => 'string']); $this->_conn->delete('write_table', ['test_string' => null], ['test_string' => 'string']);
$data = $this->_conn->fetchAll('SELECT * FROM write_table WHERE test_int = 30'); $data = $this->_conn->fetchAll('SELECT * FROM write_table WHERE test_int = 30');
$this->assertCount(0, $data); self::assertCount(0, $data);
} }
} }
...@@ -17,7 +17,7 @@ class DebugStackTest extends \Doctrine\Tests\DbalTestCase ...@@ -17,7 +17,7 @@ class DebugStackTest extends \Doctrine\Tests\DbalTestCase
public function testLoggedQuery() public function testLoggedQuery()
{ {
$this->logger->startQuery('SELECT column FROM table'); $this->logger->startQuery('SELECT column FROM table');
$this->assertEquals( self::assertEquals(
array( array(
1 => array( 1 => array(
'sql' => 'SELECT column FROM table', 'sql' => 'SELECT column FROM table',
...@@ -30,16 +30,16 @@ class DebugStackTest extends \Doctrine\Tests\DbalTestCase ...@@ -30,16 +30,16 @@ class DebugStackTest extends \Doctrine\Tests\DbalTestCase
); );
$this->logger->stopQuery(); $this->logger->stopQuery();
$this->assertGreaterThan(0, $this->logger->queries[1]['executionMS']); self::assertGreaterThan(0, $this->logger->queries[1]['executionMS']);
} }
public function testLoggedQueryDisabled() public function testLoggedQueryDisabled()
{ {
$this->logger->enabled = false; $this->logger->enabled = false;
$this->logger->startQuery('SELECT column FROM table'); $this->logger->startQuery('SELECT column FROM table');
$this->assertEquals(array(), $this->logger->queries); self::assertEquals(array(), $this->logger->queries);
$this->logger->stopQuery(); $this->logger->stopQuery();
$this->assertEquals(array(), $this->logger->queries); self::assertEquals(array(), $this->logger->queries);
} }
} }
...@@ -17,18 +17,18 @@ class MySQL57PlatformTest extends AbstractMySQLPlatformTestCase ...@@ -17,18 +17,18 @@ class MySQL57PlatformTest extends AbstractMySQLPlatformTestCase
public function testHasNativeJsonType() public function testHasNativeJsonType()
{ {
$this->assertTrue($this->_platform->hasNativeJsonType()); self::assertTrue($this->_platform->hasNativeJsonType());
} }
public function testReturnsJsonTypeDeclarationSQL() public function testReturnsJsonTypeDeclarationSQL()
{ {
$this->assertSame('JSON', $this->_platform->getJsonTypeDeclarationSQL(array())); self::assertSame('JSON', $this->_platform->getJsonTypeDeclarationSQL(array()));
} }
public function testInitializesJsonTypeMapping() public function testInitializesJsonTypeMapping()
{ {
$this->assertTrue($this->_platform->hasDoctrineTypeMappingFor('json')); self::assertTrue($this->_platform->hasDoctrineTypeMappingFor('json'));
$this->assertSame(Type::JSON, $this->_platform->getDoctrineTypeMapping('json')); self::assertSame(Type::JSON, $this->_platform->getDoctrineTypeMapping('json'));
} }
/** /**
......
...@@ -14,7 +14,7 @@ class MySqlPlatformTest extends AbstractMySQLPlatformTestCase ...@@ -14,7 +14,7 @@ class MySqlPlatformTest extends AbstractMySQLPlatformTestCase
public function testHasCorrectDefaultTransactionIsolationLevel() public function testHasCorrectDefaultTransactionIsolationLevel()
{ {
$this->assertEquals( self::assertEquals(
Connection::TRANSACTION_REPEATABLE_READ, Connection::TRANSACTION_REPEATABLE_READ,
$this->_platform->getDefaultTransactionIsolationLevel() $this->_platform->getDefaultTransactionIsolationLevel()
); );
......
...@@ -13,7 +13,7 @@ class PostgreSql91PlatformTest extends PostgreSqlPlatformTest ...@@ -13,7 +13,7 @@ class PostgreSql91PlatformTest extends PostgreSqlPlatformTest
public function testColumnCollationDeclarationSQL() public function testColumnCollationDeclarationSQL()
{ {
$this->assertEquals( self::assertEquals(
'COLLATE "en_US.UTF-8"', 'COLLATE "en_US.UTF-8"',
$this->_platform->getColumnCollationDeclarationSQL('en_US.UTF-8') $this->_platform->getColumnCollationDeclarationSQL('en_US.UTF-8')
); );
......
This diff is collapsed.
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