Commit 24b4ebf0 authored by Marco Pivetta's avatar Marco Pivetta Committed by GitHub

Merge pull request #2849 from lcobucci/update-build

Update build to use stages (adding PHPCS to check for CS violations)
parents 8d18a330 a39ea6b1
...@@ -8,3 +8,4 @@ build.properties export-ignore ...@@ -8,3 +8,4 @@ build.properties export-ignore
build.xml export-ignore build.xml export-ignore
phpunit.xml.dist export-ignore phpunit.xml.dist export-ignore
run-all.sh export-ignore run-all.sh export-ignore
/phpcs.xml.dist export-ignore
...@@ -5,4 +5,6 @@ dist/ ...@@ -5,4 +5,6 @@ dist/
download/ download/
vendor/ vendor/
*.phpunit.xml *.phpunit.xml
composer.lock composer.lock
\ No newline at end of file /phpunit.xml
/.phpcs-cache
language: php language: php
sudo: false sudo: false
dist: trusty
cache: cache:
directories: directories:
...@@ -8,6 +9,7 @@ cache: ...@@ -8,6 +9,7 @@ cache:
php: php:
- 7.1 - 7.1
- 7.2
- nightly - nightly
env: env:
...@@ -15,148 +17,215 @@ env: ...@@ -15,148 +17,215 @@ env:
- DB=mysql - DB=mysql
- DB=mysqli - DB=mysqli
before_install:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
before_script: before_script:
- if [[ $TRAVIS_PHP_VERSION = '7.1' && $DB = 'sqlite' ]]; then PHPUNIT_FLAGS="--coverage-clover .clover.xml"; else PHPUNIT_FLAGS=""; fi - if [[ "$DB" == "mysql" || "$DB" == "mysqli" || "$DB" == "mariadb" ]]; then mysql < tests/travis/create-mysql-schema.sql; fi;
- if [[ "$PHPUNIT_FLAGS" == "" ]]; then phpenv config-rm xdebug.ini || true; fi
- if [ "$MYSQL_VERSION" == "5.7" ]; then bash ./tests/travis/install-mysql-5.7.sh; fi; install:
- if [[ "$MYSQL_VERSION" == "5.6" || "$MYSQL_VERSION" == "5.7" ]]; then mysql -e "CREATE SCHEMA doctrine_tests; GRANT ALL PRIVILEGES ON doctrine_tests.* to travis@'%'"; fi; - travis_retry composer -n install
- if [[ "$MYSQL_VERSION" == "5.6" || "$MYSQL_VERSION" == "5.7" ]]; then mysql -e "CREATE SCHEMA test_create_database; GRANT ALL PRIVILEGES ON test_create_database.* to travis@'%'"; fi;
- if [[ "$MYSQL_VERSION" == "5.6" || "$MYSQL_VERSION" == "5.7" ]]; then mysql -e "CREATE SCHEMA test_drop_database; GRANT ALL PRIVILEGES ON test_drop_database.* to travis@'%'"; fi;
matrix:
fast_finish: true
include:
- php: 7.1
env: DB=mysql MYSQL_VERSION=5.6
dist: trusty
- php: nightly
env: DB=mysql MYSQL_VERSION=5.6
dist: trusty
- php: 7.1 script: ./vendor/bin/phpunit --configuration tests/travis/$DB.travis.xml
env: DB=mysqli MYSQL_VERSION=5.6
dist: trusty jobs:
allow_failures:
- php: nightly - php: nightly
env: DB=mysqli MYSQL_VERSION=5.6
dist: trusty
- php: 7.1 include:
- stage: Test
php: 7.1
env: DB=mysql MYSQL_VERSION=5.7 env: DB=mysql MYSQL_VERSION=5.7
dist: trusty
sudo: required sudo: required
- php: nightly before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
php: 7.2
env: DB=mysql MYSQL_VERSION=5.7
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
php: nightly
env: DB=mysql MYSQL_VERSION=5.7 env: DB=mysql MYSQL_VERSION=5.7
dist: trusty
sudo: required sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- php: 7.1 - stage: Test
php: 7.1
env: DB=mysqli MYSQL_VERSION=5.7 env: DB=mysqli MYSQL_VERSION=5.7
dist: trusty
sudo: required sudo: required
- php: nightly before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
php: 7.2
env: DB=mysqli MYSQL_VERSION=5.7 env: DB=mysqli MYSQL_VERSION=5.7
dist: trusty
sudo: required sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
php: nightly
env: DB=mysqli MYSQL_VERSION=5.7
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- php: 7.1 - stage: Test
php: 7.1
env: DB=mariadb MARIADB_VERSION=10.0 env: DB=mariadb MARIADB_VERSION=10.0
addons: addons:
mariadb: 10.0 mariadb: 10.0
- php: nightly - stage: Test
php: 7.2
env: DB=mariadb MARIADB_VERSION=10.0
addons:
mariadb: 10.0
- stage: Test
php: nightly
env: DB=mariadb MARIADB_VERSION=10.0 env: DB=mariadb MARIADB_VERSION=10.0
addons: addons:
mariadb: 10.0 mariadb: 10.0
- php: 7.1 - stage: Test
php: 7.1
env: DB=mariadb MARIADB_VERSION=10.1 env: DB=mariadb MARIADB_VERSION=10.1
addons: addons:
mariadb: 10.1 mariadb: 10.1
- php: nightly - stage: Test
php: 7.2
env: DB=mariadb MARIADB_VERSION=10.1
addons:
mariadb: 10.1
- stage: Test
php: nightly
env: DB=mariadb MARIADB_VERSION=10.1 env: DB=mariadb MARIADB_VERSION=10.1
addons: addons:
mariadb: 10.1 mariadb: 10.1
- php: 7.1 - stage: Test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.2
services:
- postgresql
addons: addons:
postgresql: "9.2" postgresql: "9.2"
- stage: Test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=9.2
services: services:
- postgresql - postgresql
env: DB=pgsql POSTGRESQL_VERSION=9.2
- php: nightly
addons: addons:
postgresql: "9.2" postgresql: "9.2"
- stage: Test
php: nightly
env: DB=pgsql POSTGRESQL_VERSION=9.2
services: services:
- postgresql - postgresql
env: DB=pgsql POSTGRESQL_VERSION=9.2 addons:
postgresql: "9.2"
- php: 7.1 - stage: Test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.3
services:
- postgresql
addons: addons:
postgresql: "9.3" postgresql: "9.3"
- stage: Test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=9.3
services: services:
- postgresql - postgresql
env: DB=pgsql POSTGRESQL_VERSION=9.3
- php: nightly
addons: addons:
postgresql: "9.3" postgresql: "9.3"
- stage: Test
php: nightly
env: DB=pgsql POSTGRESQL_VERSION=9.3
services: services:
- postgresql - postgresql
env: DB=pgsql POSTGRESQL_VERSION=9.3 addons:
postgresql: "9.3"
- php: 7.1 - stage: Test
php: 7.1
env: DB=pgsql POSTGRESQL_VERSION=9.4
services:
- postgresql
addons: addons:
postgresql: "9.4" postgresql: "9.4"
- stage: Test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=9.4
services: services:
- postgresql - postgresql
env: DB=pgsql POSTGRESQL_VERSION=9.4
- php: nightly
addons: addons:
postgresql: "9.4" postgresql: "9.4"
- stage: Test
php: nightly
env: DB=pgsql POSTGRESQL_VERSION=9.4
services: services:
- postgresql - postgresql
env: DB=pgsql POSTGRESQL_VERSION=9.4 addons:
postgresql: "9.4"
- php: 7.1 - stage: Test
sudo: false php: 7.1
dist: trusty env: DB=pgsql POSTGRESQL_VERSION=9.5
services:
- postgresql
addons: addons:
postgresql: "9.5" postgresql: "9.5"
- stage: Test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=9.5
services: services:
- postgresql - postgresql
env: DB=pgsql POSTGRESQL_VERSION=9.5
- php: nightly
sudo: false
dist: trusty
addons: addons:
postgresql: "9.5" postgresql: "9.5"
- stage: Test
php: nightly
env: DB=pgsql POSTGRESQL_VERSION=9.5
services: services:
- postgresql - postgresql
env: DB=pgsql POSTGRESQL_VERSION=9.5 addons:
postgresql: "9.5"
- php: 7.1 - stage: Test
sudo: false php: 7.1
dist: trusty env: DB=pgsql POSTGRESQL_VERSION=9.6
services:
- postgresql
addons: addons:
postgresql: "9.6" postgresql: "9.6"
- stage: Test
php: 7.2
env: DB=pgsql POSTGRESQL_VERSION=9.6
services: services:
- postgresql - postgresql
env: DB=pgsql POSTGRESQL_VERSION=9.6
- php: nightly
sudo: false
dist: trusty
addons: addons:
postgresql: "9.6" postgresql: "9.6"
- stage: Test
php: nightly
env: DB=pgsql POSTGRESQL_VERSION=9.6
services: services:
- postgresql - postgresql
env: DB=pgsql POSTGRESQL_VERSION=9.6 addons:
postgresql: "9.6"
allow_failures:
- php: nightly
after_script:
- if [[ "$PHPUNIT_FLAGS" != "" ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [[ "$PHPUNIT_FLAGS" != "" ]]; then php ocular.phar code-coverage:upload --format=php-clover .clover.xml; fi
install:
- travis_retry composer install
script: ./vendor/bin/phpunit --configuration tests/travis/$DB.travis.xml $PHPUNIT_FLAGS - stage: Coverage
php: 7.1
env: DB=sqlite
before_script:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi
script:
- ./vendor/bin/phpunit --configuration tests/travis/$DB.travis.xml --coverage-clover clover.xml
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover clover.xml
- stage: Coding standard
php: nightly
script:
- ./vendor/bin/phpcs
...@@ -17,9 +17,11 @@ ...@@ -17,9 +17,11 @@
"doctrine/common": "^2.7.1" "doctrine/common": "^2.7.1"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5.4.6", "phpunit/phpunit": "^6.3",
"phpunit/phpunit-mock-objects": "!=3.2.4,!=3.2.5", "phpunit/phpunit-mock-objects": "!=3.2.4,!=3.2.5",
"symfony/console": "2.*||^3.0" "symfony/console": "2.*||^3.0",
"doctrine/coding-standard": "^1.0",
"squizlabs/php_codesniffer": "^3.0"
}, },
"suggest": { "suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files." "symfony/console": "For helpful console commands such as SQL execution and import of files."
......
<?xml version="1.0"?>
<ruleset>
<arg name="basepath" value="."/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="80"/>
<arg name="cache" value=".phpcs-cache"/>
<arg name="colors" />
<!-- Ignore warnings and show progress of the run -->
<arg value="np"/>
<file>lib</file>
<file>tests</file>
<rule ref="Doctrine"/>
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase">
<exclude-pattern>lib/Doctrine/DBAL/Events.php</exclude-pattern>
</rule>
</ruleset>
...@@ -12,10 +12,12 @@ ...@@ -12,10 +12,12 @@
Example: phpunit -c mysqlconf.xml Example: phpunit -c mysqlconf.xml
--> -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
colors="true" colors="true"
bootstrap="vendor/autoload.php" verbose="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
> >
<php> <php>
<ini name="error_reporting" value="-1" /> <ini name="error_reporting" value="-1" />
...@@ -30,7 +32,7 @@ ...@@ -30,7 +32,7 @@
<var name="db_port" value="3306"/> <var name="db_port" value="3306"/>
--> -->
<!--<var name="db_event_subscribers" value="Doctrine\DBAL\Event\Listeners\OracleSessionInit">--> <!--<var name="db_event_subscribers" value="Doctrine\DBAL\Event\Listeners\OracleSessionInit">-->
<!-- Database for temporary connections (i.e. to drop/create the main database) --> <!-- Database for temporary connections (i.e. to drop/create the main database) -->
<var name="tmpdb_type" value="pdo_mysql"/> <var name="tmpdb_type" value="pdo_mysql"/>
<var name="tmpdb_host" value="localhost" /> <var name="tmpdb_host" value="localhost" />
...@@ -49,6 +51,7 @@ ...@@ -49,6 +51,7 @@
<directory>./tests/Doctrine/Tests/DBAL/Performance</directory> <directory>./tests/Doctrine/Tests/DBAL/Performance</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<listeners> <listeners>
<listener class="Doctrine\Tests\DbalPerformanceTestListener"/> <listener class="Doctrine\Tests\DbalPerformanceTestListener"/>
</listeners> </listeners>
......
...@@ -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());
} }
} }
...@@ -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());
} }
} }
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
namespace Doctrine\Tests\DBAL; namespace Doctrine\Tests\DBAL;
use Doctrine\DBAL\DBALException;
use Doctrine\Tests\Mocks\PDOMock;
class DriverManagerTest extends \Doctrine\Tests\DbalTestCase class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
{ {
/** /**
...@@ -21,7 +24,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -21,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());
} }
/** /**
...@@ -36,7 +39,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -36,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));
} }
/** /**
...@@ -64,7 +67,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -64,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()
...@@ -77,12 +80,12 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -77,12 +80,12 @@ 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()
{ {
$this->setExpectedException('\Doctrine\DBAL\DBALException'); $this->expectException(DBALException::class);
$options = array( $options = array(
'pdo' => new \PDO('sqlite::memory:'), 'pdo' => new \PDO('sqlite::memory:'),
...@@ -94,7 +97,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -94,7 +97,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
public function testInvalidDriverClass() public function testInvalidDriverClass()
{ {
$this->setExpectedException('\Doctrine\DBAL\DBALException'); $this->expectException(DBALException::class);
$options = array( $options = array(
'driverClass' => 'stdClass' 'driverClass' => 'stdClass'
...@@ -110,7 +113,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -110,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());
} }
/** /**
...@@ -123,7 +126,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -123,7 +126,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
); );
if ($expected === false) { if ($expected === false) {
$this->setExpectedException('Doctrine\DBAL\DBALException'); $this->expectException(DBALException::class);
} }
$conn = \Doctrine\DBAL\DriverManager::getConnection($options); $conn = \Doctrine\DBAL\DriverManager::getConnection($options);
...@@ -131,16 +134,16 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -131,16 +134,16 @@ 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]);
} }
} }
} }
public function databaseUrls() public function databaseUrls()
{ {
$pdoMock = $this->getMock('Doctrine\Tests\Mocks\PDOMock'); $pdoMock = $this->createMock(PDOMock::class);
return array( return array(
'simple URL' => array( 'simple URL' => array(
......
...@@ -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());
} }
} }
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
namespace Doctrine\Tests\DBAL\Exception; namespace Doctrine\Tests\DBAL\Exception;
use Doctrine\DBAL\Exception\InvalidArgumentException; use Doctrine\DBAL\Exception\InvalidArgumentException;
use PHPUnit_Framework_TestCase;
/** /**
* Tests for {@see \Doctrine\DBAL\Exception\InvalidArgumentException} * Tests for {@see \Doctrine\DBAL\Exception\InvalidArgumentException}
...@@ -29,13 +28,13 @@ use PHPUnit_Framework_TestCase; ...@@ -29,13 +28,13 @@ use PHPUnit_Framework_TestCase;
* *
* @author Marco Pivetta <ocramius@gmail.com> * @author Marco Pivetta <ocramius@gmail.com>
*/ */
class InvalidArgumentExceptionTest extends PHPUnit_Framework_TestCase class InvalidArgumentExceptionTest extends \PHPUnit\Framework\TestCase
{ {
public function testFromEmptyCriteria() public function testFromEmptyCriteria()
{ {
$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
...@@ -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');
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace Doctrine\Tests\DBAL\Functional; namespace Doctrine\Tests\DBAL\Functional;
use Doctrine\DBAL\Driver\ExceptionConverterDriver; use Doctrine\DBAL\Driver\ExceptionConverterDriver;
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException; use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
...@@ -26,8 +26,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -26,8 +26,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->insert("duplicatekey_table", array('id' => 1)); $this->_conn->insert("duplicatekey_table", array('id' => 1));
$this->setExpectedException( $this->expectException(Exception\UniqueConstraintViolationException::class);
'\Doctrine\DBAL\Exception\UniqueConstraintViolationException');
$this->_conn->insert("duplicatekey_table", array('id' => 1)); $this->_conn->insert("duplicatekey_table", array('id' => 1));
} }
...@@ -35,7 +34,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -35,7 +34,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
{ {
$sql = "SELECT * FROM unknown_table"; $sql = "SELECT * FROM unknown_table";
$this->setExpectedException('\Doctrine\DBAL\Exception\TableNotFoundException'); $this->expectException(Exception\TableNotFoundException::class);
$this->_conn->executeQuery($sql); $this->_conn->executeQuery($sql);
} }
...@@ -46,7 +45,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -46,7 +45,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table->addColumn('id', 'integer', array()); $table->addColumn('id', 'integer', array());
$table->setPrimaryKey(array('id')); $table->setPrimaryKey(array('id'));
$this->setExpectedException('\Doctrine\DBAL\Exception\TableExistsException'); $this->expectException(Exception\TableExistsException::class);
$schemaManager->createTable($table); $schemaManager->createTable($table);
$schemaManager->createTable($table); $schemaManager->createTable($table);
} }
...@@ -68,11 +67,11 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -68,11 +67,11 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
throw $exception; throw $exception;
} }
$this->setExpectedException('\Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException'); $this->expectException(Exception\ForeignKeyConstraintViolationException::class);
try { try {
$this->_conn->insert('owning_table', array('id' => 2, 'constraint_id' => 2)); $this->_conn->insert('owning_table', array('id' => 2, 'constraint_id' => 2));
} catch (ForeignKeyConstraintViolationException $exception) { } catch (Exception\ForeignKeyConstraintViolationException $exception) {
$this->tearDownForeignKeyConstraintViolationExceptionTest(); $this->tearDownForeignKeyConstraintViolationExceptionTest();
throw $exception; throw $exception;
...@@ -102,11 +101,11 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -102,11 +101,11 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
throw $exception; throw $exception;
} }
$this->setExpectedException('\Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException'); $this->expectException(Exception\ForeignKeyConstraintViolationException::class);
try { try {
$this->_conn->update('constraint_error_table', array('id' => 2), array('id' => 1)); $this->_conn->update('constraint_error_table', array('id' => 2), array('id' => 1));
} catch (ForeignKeyConstraintViolationException $exception) { } catch (Exception\ForeignKeyConstraintViolationException $exception) {
$this->tearDownForeignKeyConstraintViolationExceptionTest(); $this->tearDownForeignKeyConstraintViolationExceptionTest();
throw $exception; throw $exception;
...@@ -136,11 +135,11 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -136,11 +135,11 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
throw $exception; throw $exception;
} }
$this->setExpectedException('\Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException'); $this->expectException(Exception\ForeignKeyConstraintViolationException::class);
try { try {
$this->_conn->delete('constraint_error_table', array('id' => 1)); $this->_conn->delete('constraint_error_table', array('id' => 1));
} catch (ForeignKeyConstraintViolationException $exception) { } catch (Exception\ForeignKeyConstraintViolationException $exception) {
$this->tearDownForeignKeyConstraintViolationExceptionTest(); $this->tearDownForeignKeyConstraintViolationExceptionTest();
throw $exception; throw $exception;
...@@ -172,11 +171,11 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -172,11 +171,11 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
throw $exception; throw $exception;
} }
$this->setExpectedException('\Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException'); $this->expectException(Exception\ForeignKeyConstraintViolationException::class);
try { try {
$this->_conn->executeUpdate($platform->getTruncateTableSQL('constraint_error_table')); $this->_conn->executeUpdate($platform->getTruncateTableSQL('constraint_error_table'));
} catch (ForeignKeyConstraintViolationException $exception) { } catch (Exception\ForeignKeyConstraintViolationException $exception) {
$this->tearDownForeignKeyConstraintViolationExceptionTest(); $this->tearDownForeignKeyConstraintViolationExceptionTest();
throw $exception; throw $exception;
...@@ -202,7 +201,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -202,7 +201,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->exec($sql); $this->_conn->exec($sql);
} }
$this->setExpectedException('\Doctrine\DBAL\Exception\NotNullConstraintViolationException'); $this->expectException(Exception\NotNullConstraintViolationException::class);
$this->_conn->insert("notnull_table", array('id' => 1, 'value' => null)); $this->_conn->insert("notnull_table", array('id' => 1, 'value' => null));
} }
...@@ -217,7 +216,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -217,7 +216,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->exec($sql); $this->_conn->exec($sql);
} }
$this->setExpectedException('\Doctrine\DBAL\Exception\InvalidFieldNameException'); $this->expectException(Exception\InvalidFieldNameException::class);
$this->_conn->insert("bad_fieldname_table", array('name' => 5)); $this->_conn->insert("bad_fieldname_table", array('name' => 5));
} }
...@@ -236,7 +235,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -236,7 +235,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
} }
$sql = 'SELECT id FROM ambiguous_list_table, ambiguous_list_table_2'; $sql = 'SELECT id FROM ambiguous_list_table, ambiguous_list_table_2';
$this->setExpectedException('\Doctrine\DBAL\Exception\NonUniqueFieldNameException'); $this->expectException(Exception\NonUniqueFieldNameException::class);
$this->_conn->executeQuery($sql); $this->_conn->executeQuery($sql);
} }
...@@ -253,7 +252,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -253,7 +252,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
} }
$this->_conn->insert("unique_field_table", array('id' => 5)); $this->_conn->insert("unique_field_table", array('id' => 5));
$this->setExpectedException('\Doctrine\DBAL\Exception\UniqueConstraintViolationException'); $this->expectException(Exception\UniqueConstraintViolationException::class);
$this->_conn->insert("unique_field_table", array('id' => 5)); $this->_conn->insert("unique_field_table", array('id' => 5));
} }
...@@ -266,7 +265,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -266,7 +265,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->getSchemaManager()->createTable($table); $this->_conn->getSchemaManager()->createTable($table);
$sql = 'SELECT id FRO syntax_error_table'; $sql = 'SELECT id FRO syntax_error_table';
$this->setExpectedException('\Doctrine\DBAL\Exception\SyntaxErrorException'); $this->expectException(Exception\SyntaxErrorException::class);
$this->_conn->executeQuery($sql); $this->_conn->executeQuery($sql);
} }
...@@ -299,7 +298,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -299,7 +298,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table = $schema->createTable("no_connection"); $table = $schema->createTable("no_connection");
$table->addColumn('id', 'integer'); $table->addColumn('id', 'integer');
$this->setExpectedException($exceptionClass); $this->expectException($exceptionClass);
foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) { foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) {
$conn->exec($sql); $conn->exec($sql);
} }
...@@ -309,8 +308,8 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -309,8 +308,8 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
{ {
return array( return array(
// mode 0 is considered read-only on Windows // mode 0 is considered read-only on Windows
array(0000, defined('PHP_WINDOWS_VERSION_BUILD') ? '\Doctrine\DBAL\Exception\ReadOnlyException' : '\Doctrine\DBAL\Exception\ConnectionException'), array(0000, defined('PHP_WINDOWS_VERSION_BUILD') ? Exception\ReadOnlyException::class : Exception\ConnectionException::class),
array(0444, '\Doctrine\DBAL\Exception\ReadOnlyException'), array(0444, Exception\ReadOnlyException::class),
); );
} }
...@@ -340,7 +339,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -340,7 +339,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table = $schema->createTable("no_connection"); $table = $schema->createTable("no_connection");
$table->addColumn('id', 'integer'); $table->addColumn('id', 'integer');
$this->setExpectedException('Doctrine\DBAL\Exception\ConnectionException'); $this->expectException(Exception\ConnectionException::class);
foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) { foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) {
$conn->exec($sql); $conn->exec($sql);
......
...@@ -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'));
} }
} }
...@@ -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;
} }
......
...@@ -7,7 +7,7 @@ use Doctrine\DBAL\Schema\SQLServerSchemaManager; ...@@ -7,7 +7,7 @@ use Doctrine\DBAL\Schema\SQLServerSchemaManager;
/** /**
* @group DBAL-461 * @group DBAL-461
*/ */
class DBAL461Test extends \PHPUnit_Framework_TestCase class DBAL461Test extends \PHPUnit\Framework\TestCase
{ {
public function testIssue() public function testIssue()
{ {
...@@ -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'));
} }
/** /**
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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