Upgrade to PHPUnit 6.3

parent 7ca735db
......@@ -12,10 +12,12 @@
Example: phpunit -c mysqlconf.xml
-->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
bootstrap="vendor/autoload.php"
verbose="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
>
<php>
<ini name="error_reporting" value="-1" />
......@@ -30,7 +32,7 @@
<var name="db_port" value="3306"/>
-->
<!--<var name="db_event_subscribers" value="Doctrine\DBAL\Event\Listeners\OracleSessionInit">-->
<!-- Database for temporary connections (i.e. to drop/create the main database) -->
<var name="tmpdb_type" value="pdo_mysql"/>
<var name="tmpdb_host" value="localhost" />
......@@ -49,6 +51,7 @@
<directory>./tests/Doctrine/Tests/DBAL/Performance</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="Doctrine\Tests\DbalPerformanceTestListener"/>
</listeners>
......
......@@ -4,16 +4,18 @@ namespace Doctrine\Tests\DBAL;
use Doctrine\Common\Cache\Cache;
use Doctrine\Common\EventManager;
use Doctrine\DBAL\Cache\ArrayStatement;
use Doctrine\DBAL\Cache\QueryCacheProfile;
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\ConnectionException;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Events;
use Doctrine\DBAL\Exception\InvalidArgumentException;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\Tests\Mocks\DriverConnectionMock;
use Doctrine\Tests\Mocks\DriverMock;
use Doctrine\DBAL\Cache\ArrayStatement;
use Doctrine\Tests\Mocks\VersionAwarePlatformDriverMock;
class ConnectionTest extends \Doctrine\Tests\DbalTestCase
......@@ -64,25 +66,25 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
public function testCommitWithNoActiveTransaction_ThrowsException()
{
$this->setExpectedException('Doctrine\DBAL\ConnectionException');
$this->expectException(ConnectionException::class);
$this->_conn->commit();
}
public function testRollbackWithNoActiveTransaction_ThrowsException()
{
$this->setExpectedException('Doctrine\DBAL\ConnectionException');
$this->expectException(ConnectionException::class);
$this->_conn->rollBack();
}
public function testSetRollbackOnlyNoActiveTransaction_ThrowsException()
{
$this->setExpectedException('Doctrine\DBAL\ConnectionException');
$this->expectException(ConnectionException::class);
$this->_conn->setRollbackOnly();
}
public function testIsRollbackOnlyNoActiveTransaction_ThrowsException()
{
$this->setExpectedException('Doctrine\DBAL\ConnectionException');
$this->expectException(ConnectionException::class);
$this->_conn->isRollbackOnly();
}
......@@ -156,7 +158,8 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
*/
public function testDriverExceptionIsWrapped($method)
{
$this->setExpectedException('Doctrine\DBAL\DBALException', "An exception occurred while executing 'MUUHAAAAHAAAA':\n\nSQLSTATE[HY000]: General error: 1 near \"MUUHAAAAHAAAA\"");
$this->expectException(DBALException::class);
$this->expectExceptionMessage("An exception occurred while executing 'MUUHAAAAHAAAA':\n\nSQLSTATE[HY000]: General error: 1 near \"MUUHAAAAHAAAA\"");
$con = \Doctrine\DBAL\DriverManager::getConnection(array(
'driver' => 'pdo_sqlite',
......@@ -666,7 +669,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
$conn = new Connection(array('pdo' => $pdoMock), $driver);
$this->setExpectedException('Doctrine\DBAL\Exception\InvalidArgumentException');
$this->expectException(InvalidArgumentException::class);
$conn->delete('kittens', array());
}
......
......@@ -2,6 +2,9 @@
namespace Doctrine\Tests\DBAL;
use Doctrine\DBAL\DBALException;
use Doctrine\Tests\Mocks\PDOMock;
class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
{
/**
......@@ -82,7 +85,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
public function testInvalidWrapperClass()
{
$this->setExpectedException('\Doctrine\DBAL\DBALException');
$this->expectException(DBALException::class);
$options = array(
'pdo' => new \PDO('sqlite::memory:'),
......@@ -94,7 +97,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
public function testInvalidDriverClass()
{
$this->setExpectedException('\Doctrine\DBAL\DBALException');
$this->expectException(DBALException::class);
$options = array(
'driverClass' => 'stdClass'
......@@ -123,7 +126,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
);
if ($expected === false) {
$this->setExpectedException('Doctrine\DBAL\DBALException');
$this->expectException(DBALException::class);
}
$conn = \Doctrine\DBAL\DriverManager::getConnection($options);
......@@ -140,7 +143,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
public function databaseUrls()
{
$pdoMock = $this->getMock('Doctrine\Tests\Mocks\PDOMock');
$pdoMock = $this->createMock(PDOMock::class);
return array(
'simple URL' => array(
......
......@@ -20,7 +20,6 @@
namespace Doctrine\Tests\DBAL\Exception;
use Doctrine\DBAL\Exception\InvalidArgumentException;
use PHPUnit_Framework_TestCase;
/**
* Tests for {@see \Doctrine\DBAL\Exception\InvalidArgumentException}
......@@ -29,7 +28,7 @@ use PHPUnit_Framework_TestCase;
*
* @author Marco Pivetta <ocramius@gmail.com>
*/
class InvalidArgumentExceptionTest extends PHPUnit_Framework_TestCase
class InvalidArgumentExceptionTest extends \PHPUnit\Framework\TestCase
{
public function testFromEmptyCriteria()
{
......
......@@ -30,7 +30,8 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
{
$this->_conn->beginTransaction();
$this->_conn->setRollbackOnly();
$this->setExpectedException('Doctrine\DBAL\ConnectionException');
$this->expectException(ConnectionException::class);
$this->_conn->commit();
}
......@@ -121,7 +122,8 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->markTestSkipped('This test requires the platform not to support savepoints.');
}
$this->setExpectedException('Doctrine\DBAL\ConnectionException', "Savepoints are not supported by this driver.");
$this->expectException(ConnectionException::class);
$this->expectExceptionMessage("Savepoints are not supported by this driver.");
$this->_conn->setNestTransactionsWithSavepoints(true);
}
......@@ -132,7 +134,8 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->markTestSkipped('This test requires the platform not to support savepoints.');
}
$this->setExpectedException('Doctrine\DBAL\ConnectionException', "Savepoints are not supported by this driver.");
$this->expectException(ConnectionException::class);
$this->expectExceptionMessage("Savepoints are not supported by this driver.");
$this->_conn->createSavepoint('foo');
}
......@@ -143,7 +146,8 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->markTestSkipped('This test requires the platform not to support savepoints.');
}
$this->setExpectedException('Doctrine\DBAL\ConnectionException', "Savepoints are not supported by this driver.");
$this->expectException(ConnectionException::class);
$this->expectExceptionMessage("Savepoints are not supported by this driver.");
$this->_conn->releaseSavepoint('foo');
}
......@@ -154,7 +158,8 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->markTestSkipped('This test requires the platform not to support savepoints.');
}
$this->setExpectedException('Doctrine\DBAL\ConnectionException', "Savepoints are not supported by this driver.");
$this->expectException(ConnectionException::class);
$this->expectExceptionMessage("Savepoints are not supported by this driver.");
$this->_conn->rollbackSavepoint('foo');
}
......
......@@ -2,7 +2,7 @@
namespace Doctrine\Tests\DBAL\Functional;
use Doctrine\DBAL\Driver\ExceptionConverterDriver;
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException;
use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Schema\Table;
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->setExpectedException(
'\Doctrine\DBAL\Exception\UniqueConstraintViolationException');
$this->expectException(Exception\UniqueConstraintViolationException::class);
$this->_conn->insert("duplicatekey_table", array('id' => 1));
}
......@@ -35,7 +34,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
{
$sql = "SELECT * FROM unknown_table";
$this->setExpectedException('\Doctrine\DBAL\Exception\TableNotFoundException');
$this->expectException(Exception\TableNotFoundException::class);
$this->_conn->executeQuery($sql);
}
......@@ -46,7 +45,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table->addColumn('id', 'integer', array());
$table->setPrimaryKey(array('id'));
$this->setExpectedException('\Doctrine\DBAL\Exception\TableExistsException');
$this->expectException(Exception\TableExistsException::class);
$schemaManager->createTable($table);
$schemaManager->createTable($table);
}
......@@ -68,11 +67,11 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
throw $exception;
}
$this->setExpectedException('\Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException');
$this->expectException(Exception\ForeignKeyConstraintViolationException::class);
try {
$this->_conn->insert('owning_table', array('id' => 2, 'constraint_id' => 2));
} catch (ForeignKeyConstraintViolationException $exception) {
} catch (Exception\ForeignKeyConstraintViolationException $exception) {
$this->tearDownForeignKeyConstraintViolationExceptionTest();
throw $exception;
......@@ -102,11 +101,11 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
throw $exception;
}
$this->setExpectedException('\Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException');
$this->expectException(Exception\ForeignKeyConstraintViolationException::class);
try {
$this->_conn->update('constraint_error_table', array('id' => 2), array('id' => 1));
} catch (ForeignKeyConstraintViolationException $exception) {
} catch (Exception\ForeignKeyConstraintViolationException $exception) {
$this->tearDownForeignKeyConstraintViolationExceptionTest();
throw $exception;
......@@ -136,11 +135,11 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
throw $exception;
}
$this->setExpectedException('\Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException');
$this->expectException(Exception\ForeignKeyConstraintViolationException::class);
try {
$this->_conn->delete('constraint_error_table', array('id' => 1));
} catch (ForeignKeyConstraintViolationException $exception) {
} catch (Exception\ForeignKeyConstraintViolationException $exception) {
$this->tearDownForeignKeyConstraintViolationExceptionTest();
throw $exception;
......@@ -172,11 +171,11 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
throw $exception;
}
$this->setExpectedException('\Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException');
$this->expectException(Exception\ForeignKeyConstraintViolationException::class);
try {
$this->_conn->executeUpdate($platform->getTruncateTableSQL('constraint_error_table'));
} catch (ForeignKeyConstraintViolationException $exception) {
} catch (Exception\ForeignKeyConstraintViolationException $exception) {
$this->tearDownForeignKeyConstraintViolationExceptionTest();
throw $exception;
......@@ -202,7 +201,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$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));
}
......@@ -217,7 +216,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->exec($sql);
}
$this->setExpectedException('\Doctrine\DBAL\Exception\InvalidFieldNameException');
$this->expectException(Exception\InvalidFieldNameException::class);
$this->_conn->insert("bad_fieldname_table", array('name' => 5));
}
......@@ -236,7 +235,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
}
$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);
}
......@@ -253,7 +252,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
}
$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));
}
......@@ -266,7 +265,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->_conn->getSchemaManager()->createTable($table);
$sql = 'SELECT id FRO syntax_error_table';
$this->setExpectedException('\Doctrine\DBAL\Exception\SyntaxErrorException');
$this->expectException(Exception\SyntaxErrorException::class);
$this->_conn->executeQuery($sql);
}
......@@ -299,7 +298,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table = $schema->createTable("no_connection");
$table->addColumn('id', 'integer');
$this->setExpectedException($exceptionClass);
$this->expectException($exceptionClass);
foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) {
$conn->exec($sql);
}
......@@ -309,8 +308,8 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
{
return array(
// mode 0 is considered read-only on Windows
array(0000, defined('PHP_WINDOWS_VERSION_BUILD') ? '\Doctrine\DBAL\Exception\ReadOnlyException' : '\Doctrine\DBAL\Exception\ConnectionException'),
array(0444, '\Doctrine\DBAL\Exception\ReadOnlyException'),
array(0000, defined('PHP_WINDOWS_VERSION_BUILD') ? Exception\ReadOnlyException::class : Exception\ConnectionException::class),
array(0444, Exception\ReadOnlyException::class),
);
}
......@@ -340,7 +339,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table = $schema->createTable("no_connection");
$table->addColumn('id', 'integer');
$this->setExpectedException('Doctrine\DBAL\Exception\ConnectionException');
$this->expectException(Exception\ConnectionException::class);
foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) {
$conn->exec($sql);
......
......@@ -7,7 +7,7 @@ use Doctrine\DBAL\Schema\SQLServerSchemaManager;
/**
* @group DBAL-461
*/
class DBAL461Test extends \PHPUnit_Framework_TestCase
class DBAL461Test extends \PHPUnit\Framework\TestCase
{
public function testIssue()
{
......
......@@ -86,13 +86,13 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
public function testGetInvalidForeignKeyReferentialActionSQL()
{
$this->setExpectedException('InvalidArgumentException');
$this->expectException('InvalidArgumentException');
$this->_platform->getForeignKeyReferentialActionSQL('unknown');
}
public function testGetUnknownDoctrineMappingType()
{
$this->setExpectedException('Doctrine\DBAL\DBALException');
$this->expectException('Doctrine\DBAL\DBALException');
$this->_platform->getDoctrineTypeMapping('foobar');
}
......@@ -104,7 +104,7 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
public function testRegisterUnknownDoctrineMappingType()
{
$this->setExpectedException('Doctrine\DBAL\DBALException');
$this->expectException('Doctrine\DBAL\DBALException');
$this->_platform->registerDoctrineTypeMapping('foo', 'bar');
}
......@@ -155,7 +155,7 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
{
$table = new Table('test');
$this->setExpectedException('Doctrine\DBAL\DBALException');
$this->expectException('Doctrine\DBAL\DBALException');
$sql = $this->_platform->getCreateTableSQL($table);
}
......@@ -268,7 +268,7 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
$this->_platform->getCreateForeignKeySQL($fk, 'test')
);
} else {
$this->setExpectedException('Doctrine\DBAL\DBALException');
$this->expectException('Doctrine\DBAL\DBALException');
$this->_platform->getCreateForeignKeySQL($fk, 'test');
}
}
......@@ -695,7 +695,7 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
$index = new Index('select', array('foo'));
if (! $this->supportsInlineIndexDeclaration()) {
$this->setExpectedException('Doctrine\DBAL\DBALException');
$this->expectException('Doctrine\DBAL\DBALException');
}
$this->assertSame(
......@@ -1225,7 +1225,7 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
$this->markTestSkipped(sprintf('%s supports inline column comments.', get_class($this->_platform)));
}
$this->setExpectedException(
$this->expectException(
'Doctrine\DBAL\DBALException',
"Operation 'Doctrine\\DBAL\\Platforms\\AbstractPlatform::getInlineColumnCommentSQL' is not supported by platform.",
0
......
......@@ -51,7 +51,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
*/
public function testInvalidIdentifiers($identifier)
{
$this->setExpectedException('Doctrine\DBAL\DBALException');
$this->expectException('Doctrine\DBAL\DBALException');
$platform = $this->createPlatform();
$platform->assertValidIdentifier($identifier);
}
......
......@@ -63,7 +63,7 @@ class SQLAnywhere16PlatformTest extends SQLAnywhere12PlatformTest
public function testThrowsExceptionOnInvalidWithNullsNotDistinctIndexOptions()
{
$this->setExpectedException('UnexpectedValueException');
$this->expectException('UnexpectedValueException');
$this->_platform->getCreateIndexSQL(
new Index(
......
......@@ -340,7 +340,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
public function testCannotGeneratePrimaryKeyDeclarationSQLWithEmptyColumns()
{
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
$this->_platform->getPrimaryKeyDeclarationSQL(new Index('pk', array(), true, true));
}
......@@ -380,7 +380,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
public function testCannotGenerateUniqueConstraintDeclarationSQLWithEmptyColumns()
{
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
$this->_platform->getUniqueConstraintDeclarationSQL('constr', new Index('constr', array(), true));
}
......@@ -422,39 +422,39 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
public function testCannotGenerateInvalidForeignKeyMatchClauseSQL()
{
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
$this->_platform->getForeignKeyMatchCLauseSQL(3);
}
public function testCannotGenerateForeignKeyConstraintSQLWithEmptyLocalColumns()
{
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
$this->_platform->getForeignKeyDeclarationSQL(new ForeignKeyConstraint(array(), 'foreign_tbl', array('c', 'd')));
}
public function testCannotGenerateForeignKeyConstraintSQLWithEmptyForeignColumns()
{
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
$this->_platform->getForeignKeyDeclarationSQL(new ForeignKeyConstraint(array('a', 'b'), 'foreign_tbl', array()));
}
public function testCannotGenerateForeignKeyConstraintSQLWithEmptyForeignTableName()
{
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
$this->_platform->getForeignKeyDeclarationSQL(new ForeignKeyConstraint(array('a', 'b'), '', array('c', 'd')));
}
public function testCannotGenerateCommonIndexWithCreateConstraintSQL()
{
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
$this->_platform->getCreateConstraintSQL(new Index('fooindex', array()), new Table('footable'));
}
public function testCannotGenerateCustomConstraintWithCreateConstraintSQL()
{
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
$this->_platform->getCreateConstraintSQL($this->createMock('\Doctrine\DBAL\Schema\Constraint'), 'footable');
}
......@@ -478,7 +478,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
public function testDoesNotSupportIndexDeclarationInCreateAlterTableStatements()
{
$this->setExpectedException('\Doctrine\DBAL\DBALException');
$this->expectException('\Doctrine\DBAL\DBALException');
$this->_platform->getIndexDeclarationSQL('index', new Index('index', array()));
}
......@@ -497,14 +497,14 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
public function testCannotGenerateDropIndexSQLWithInvalidIndexParameter()
{
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
$this->_platform->getDropIndexSQL(array('index'), 'table');
}
public function testCannotGenerateDropIndexSQLWithInvalidTableParameter()
{
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
$this->_platform->getDropIndexSQL('index', array('table'));
}
......@@ -585,7 +585,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
public function testDoesNotSupportRegexp()
{
$this->setExpectedException('\Doctrine\DBAL\DBALException');
$this->expectException('\Doctrine\DBAL\DBALException');
$this->_platform->getRegexpExpression();
}
......@@ -628,7 +628,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
public function testCannotGenerateTransactionCommandWithInvalidIsolationLevel()
{
$this->setExpectedException('\InvalidArgumentException');
$this->expectException('\InvalidArgumentException');
$this->_platform->getSetTransactionIsolationSQL('invalid_transaction_isolation_level');
}
......
......@@ -648,7 +648,7 @@ class QueryBuilderTest extends \Doctrine\Tests\DbalTestCase
->innerJoin('nt', 'node', 'n', 'nt.node = n.id')
->where('nt.lang = :lang AND n.deleted != 1');
$this->setExpectedException('Doctrine\DBAL\Query\QueryException', "The given alias 'invalid' is not part of any FROM or JOIN clause table. The currently registered aliases are: news, nv.");
$this->expectException('Doctrine\DBAL\Query\QueryException', "The given alias 'invalid' is not part of any FROM or JOIN clause table. The currently registered aliases are: news, nv.");
$this->assertEquals('', $qb->getSQL());
}
......@@ -887,7 +887,7 @@ class QueryBuilderTest extends \Doctrine\Tests\DbalTestCase
->from('table_a', 'a')
->join('a', 'table_b', 'a', 'a.fk_b = a.id');
$this->setExpectedException(
$this->expectException(
'Doctrine\DBAL\Query\QueryException',
"The given alias 'a' is not unique in FROM and JOIN clause table. The currently registered aliases are: a."
);
......
......@@ -72,7 +72,7 @@ SQLDATA
array('SELECT data.age AS age, data.id AS id, data.name AS name, data.id AS id FROM test_data data WHERE (data.description LIKE :condition_0 ESCAPE "\\\\") AND (data.description LIKE :condition_1 ESCAPE \'\\\\\') ORDER BY id ASC', false, array(121 => 'condition_0', 174 => 'condition_1')),
array('SELECT data.age AS age, data.id AS id, data.name AS name, data.id AS id FROM test_data data WHERE (data.description LIKE :condition_0 ESCAPE `\\\\`) AND (data.description LIKE :condition_1 ESCAPE `\\\\`) ORDER BY id ASC', false, array(121 => 'condition_0', 174 => 'condition_1')),
array('SELECT data.age AS age, data.id AS id, data.name AS name, data.id AS id FROM test_data data WHERE (data.description LIKE :condition_0 ESCAPE \'\\\\\') AND (data.description LIKE :condition_1 ESCAPE `\\\\`) ORDER BY id ASC', false, array(121 => 'condition_0', 174 => 'condition_1')),
);
}
......@@ -419,7 +419,7 @@ SQLDATA
*/
public function testExceptionIsThrownForMissingParam($query, $params, $types = array())
{
$this->setExpectedException(
$this->expectException(
'Doctrine\DBAL\SQLParserUtilsException',
'Value for :param not found in params array. Params array key should be "param"'
);
......
......@@ -6,7 +6,7 @@ use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\ColumnDiff;
use Doctrine\DBAL\Types\Type;
class ColumnDiffTest extends \PHPUnit_Framework_TestCase
class ColumnDiffTest extends \PHPUnit\Framework\TestCase
{
/**
* @group DBAL-1255
......
......@@ -5,7 +5,7 @@ namespace Doctrine\Tests\DBAL\Schema;
use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Types\Type;
class ColumnTest extends \PHPUnit_Framework_TestCase
class ColumnTest extends \PHPUnit\Framework\TestCase
{
public function testGet()
{
......@@ -137,4 +137,4 @@ class ColumnTest extends \PHPUnit_Framework_TestCase
$this->assertArrayHasKey('comment', $columnArray);
$this->assertEquals('foo', $columnArray['comment']);
}
}
\ No newline at end of file
}
......@@ -41,7 +41,7 @@ use Doctrine\DBAL\Types\Type;
* @version $Revision$
* @author Benjamin Eberlei <kontakt@beberlei.de>
*/
class ComparatorTest extends \PHPUnit_Framework_TestCase
class ComparatorTest extends \PHPUnit\Framework\TestCase
{
public function testCompareSame1()
{
......
......@@ -12,7 +12,7 @@ use Doctrine\DBAL\Schema\DB2SchemaManager;
/**
* @covers \Doctrine\DBAL\Schema\DB2SchemaManager
*/
final class DB2SchemaManagerTest extends \PHPUnit_Framework_TestCase
final class DB2SchemaManagerTest extends \PHPUnit\Framework\TestCase
{
/**
* @var Connection|\PHPUnit_Framework_MockObject_MockObject
......
......@@ -4,7 +4,7 @@ namespace Doctrine\Tests\DBAL\Schema;
use Doctrine\DBAL\Schema\ForeignKeyConstraint;
class ForeignKeyConstraintTest extends \PHPUnit_Framework_TestCase
class ForeignKeyConstraintTest extends \PHPUnit\Framework\TestCase
{
/**
* @group DBAL-1062
......
......@@ -4,7 +4,7 @@ namespace Doctrine\Tests\DBAL\Schema;
use Doctrine\DBAL\Schema\Index;
class IndexTest extends \PHPUnit_Framework_TestCase
class IndexTest extends \PHPUnit\Framework\TestCase
{
public function createIndex($unique = false, $primary = false, $options = array())
{
......
......@@ -6,7 +6,7 @@ use Doctrine\Common\EventManager;
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\Schema\MySqlSchemaManager;
class MySqlSchemaManagerTest extends \PHPUnit_Framework_TestCase
class MySqlSchemaManagerTest extends \PHPUnit\Framework\TestCase
{
/**
*
......
......@@ -4,7 +4,7 @@ namespace Doctrine\Tests\DBAL\Schema\Platforms;
use Doctrine\DBAL\Schema\Table;
class MySQLSchemaTest extends \PHPUnit_Framework_TestCase
class MySQLSchemaTest extends \PHPUnit\Framework\TestCase
{
/**
* @var Comparator
......@@ -80,4 +80,4 @@ class MySQLSchemaTest extends \PHPUnit_Framework_TestCase
$sql
);
}
}
\ No newline at end of file
}
......@@ -6,7 +6,7 @@ use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\Schema\PostgreSqlSchemaManager;
use Doctrine\DBAL\Schema\Sequence;
class PostgreSQLSchemaManagerTest extends \PHPUnit_Framework_TestCase
class PostgreSQLSchemaManagerTest extends \PHPUnit\Framework\TestCase
{
/**
* @var \Doctrine\DBAL\Schema\PostgreSQLSchemaManager
......
......@@ -7,7 +7,7 @@ use Doctrine\DBAL\Schema\Sequence;
use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Schema\TableDiff;
class SchemaDiffTest extends \PHPUnit_Framework_TestCase
class SchemaDiffTest extends \PHPUnit\Framework\TestCase
{
public function testSchemaDiffToSql()
{
......
......@@ -6,7 +6,7 @@ use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Sequence;
use Doctrine\DBAL\Schema\Table;
class SchemaTest extends \PHPUnit_Framework_TestCase
class SchemaTest extends \PHPUnit\Framework\TestCase
{
public function testAddTable()
{
......@@ -39,7 +39,7 @@ class SchemaTest extends \PHPUnit_Framework_TestCase
public function testGetUnknownTableThrowsException()
{
$this->setExpectedException("Doctrine\DBAL\Schema\SchemaException");
$this->expectException("Doctrine\DBAL\Schema\SchemaException");
$schema = new Schema();
$schema->getTable("unknown");
......@@ -47,7 +47,7 @@ class SchemaTest extends \PHPUnit_Framework_TestCase
public function testCreateTableTwiceThrowsException()
{
$this->setExpectedException("Doctrine\DBAL\Schema\SchemaException");
$this->expectException("Doctrine\DBAL\Schema\SchemaException");
$tableName = "foo";
$table = new Table($tableName);
......@@ -124,7 +124,7 @@ class SchemaTest extends \PHPUnit_Framework_TestCase
public function testGetUnknownSequenceThrowsException()
{
$this->setExpectedException("Doctrine\DBAL\Schema\SchemaException");
$this->expectException("Doctrine\DBAL\Schema\SchemaException");
$schema = new Schema();
$schema->getSequence("unknown");
......@@ -158,7 +158,7 @@ class SchemaTest extends \PHPUnit_Framework_TestCase
public function testAddSequenceTwiceThrowsException()
{
$this->setExpectedException("Doctrine\DBAL\Schema\SchemaException");
$this->expectException("Doctrine\DBAL\Schema\SchemaException");
$sequence = new Sequence("a_seq", 1, 1);
......
......@@ -5,7 +5,7 @@ namespace Doctrine\Tests\DBAL\Schema;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\SqliteSchemaManager;
class SqliteSchemaManagerTest extends \PHPUnit_Framework_TestCase
class SqliteSchemaManagerTest extends \PHPUnit\Framework\TestCase
{
/**
......
......@@ -23,7 +23,7 @@ use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Synchronizer\SingleDatabaseSynchronizer;
class SingleDatabaseSynchronizerTest extends \PHPUnit_Framework_TestCase
class SingleDatabaseSynchronizerTest extends \PHPUnit\Framework\TestCase
{
private $conn;
private $synchronizer;
......
......@@ -6,7 +6,7 @@ use Doctrine\DBAL\Schema\Identifier;
use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\Tests\DBAL\Mocks\MockPlatform;
class TableDiffTest extends \PHPUnit_Framework_TestCase
class TableDiffTest extends \PHPUnit\Framework\TestCase
{
/**
* @group DBAL-1013
......
......@@ -12,7 +12,7 @@ class TableTest extends \Doctrine\Tests\DbalTestCase
{
public function testCreateWithInvalidTableName()
{
$this->setExpectedException('Doctrine\DBAL\DBALException');
$this->expectException('Doctrine\DBAL\DBALException');
$table = new \Doctrine\DBAL\Schema\Table('');
}
......@@ -85,7 +85,7 @@ class TableTest extends \Doctrine\Tests\DbalTestCase
public function testGetUnknownColumnThrowsException()
{
$this->setExpectedException("Doctrine\DBAL\Schema\SchemaException");
$this->expectException("Doctrine\DBAL\Schema\SchemaException");
$table = new Table("foo", array(), array(), array());
$table->getColumn('unknown');
......@@ -93,7 +93,7 @@ class TableTest extends \Doctrine\Tests\DbalTestCase
public function testAddColumnTwiceThrowsException()
{
$this->setExpectedException("Doctrine\DBAL\Schema\SchemaException");
$this->expectException("Doctrine\DBAL\Schema\SchemaException");
$type = \Doctrine\DBAL\Types\Type::getType('integer');
$columns = array();
......@@ -156,7 +156,7 @@ class TableTest extends \Doctrine\Tests\DbalTestCase
public function testGetUnknownIndexThrowsException()
{
$this->setExpectedException("Doctrine\DBAL\Schema\SchemaException");
$this->expectException("Doctrine\DBAL\Schema\SchemaException");
$table = new Table("foo", array(), array(), array());
$table->getIndex("unknownIndex");
......@@ -164,7 +164,7 @@ class TableTest extends \Doctrine\Tests\DbalTestCase
public function testAddTwoPrimaryThrowsException()
{
$this->setExpectedException("Doctrine\DBAL\Schema\SchemaException");
$this->expectException("Doctrine\DBAL\Schema\SchemaException");
$type = \Doctrine\DBAL\Types\Type::getType('integer');
$columns = array(new Column("foo", $type), new Column("bar", $type));
......@@ -177,7 +177,7 @@ class TableTest extends \Doctrine\Tests\DbalTestCase
public function testAddTwoIndexesWithSameNameThrowsException()
{
$this->setExpectedException("Doctrine\DBAL\Schema\SchemaException");
$this->expectException("Doctrine\DBAL\Schema\SchemaException");
$type = \Doctrine\DBAL\Types\Type::getType('integer');
$columns = array(new Column("foo", $type), new Column("bar", $type));
......@@ -246,7 +246,7 @@ class TableTest extends \Doctrine\Tests\DbalTestCase
public function testBuilderAddIndexWithInvalidNameThrowsException()
{
$this->setExpectedException("Doctrine\DBAL\Schema\SchemaException");
$this->expectException("Doctrine\DBAL\Schema\SchemaException");
$table = new Table("foo");
$table->addColumn("bar",'integer');
......@@ -255,7 +255,7 @@ class TableTest extends \Doctrine\Tests\DbalTestCase
public function testBuilderAddIndexWithUnknownColumnThrowsException()
{
$this->setExpectedException("Doctrine\DBAL\Schema\SchemaException");
$this->expectException("Doctrine\DBAL\Schema\SchemaException");
$table = new Table("foo");
$table->addIndex(array("bar"), "invalidName");
......@@ -271,7 +271,7 @@ class TableTest extends \Doctrine\Tests\DbalTestCase
public function testAddForeignKeyConstraint_UnknownLocalColumn_ThrowsException()
{
$this->setExpectedException("Doctrine\DBAL\Schema\SchemaException");
$this->expectException("Doctrine\DBAL\Schema\SchemaException");
$table = new Table("foo");
$table->addColumn("id", 'integer');
......@@ -284,7 +284,7 @@ class TableTest extends \Doctrine\Tests\DbalTestCase
public function testAddForeignKeyConstraint_UnknownForeignColumn_ThrowsException()
{
$this->setExpectedException("Doctrine\DBAL\Schema\SchemaException");
$this->expectException("Doctrine\DBAL\Schema\SchemaException");
$table = new Table("foo");
$table->addColumn("id", 'integer');
......
......@@ -4,7 +4,7 @@ namespace Doctrine\Tests\DBAL\Schema\Visitor;
use \Doctrine\DBAL\Schema\Visitor\CreateSchemaSqlCollector;
class CreateSchemaSqlCollectorTest extends \PHPUnit_Framework_TestCase
class CreateSchemaSqlCollectorTest extends \PHPUnit\Framework\TestCase
{
/**
* @var \Doctrine\DBAL\Platforms\AbstractPlatform|\PHPUnit_Framework_MockObject_MockObject
......
......@@ -7,7 +7,7 @@ use Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector;
/**
* @covers Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector
*/
class DropSchemaSqlCollectorTest extends \PHPUnit_Framework_TestCase
class DropSchemaSqlCollectorTest extends \PHPUnit\Framework\TestCase
{
public function testGetQueriesUsesAcceptedForeignKeys()
{
......@@ -75,7 +75,7 @@ class DropSchemaSqlCollectorTest extends \PHPUnit_Framework_TestCase
$this->getMockForAbstractClass('Doctrine\DBAL\Platforms\AbstractPlatform')
);
$this->setExpectedException( 'Doctrine\DBAL\Schema\SchemaException' );
$this->expectException( 'Doctrine\DBAL\Schema\SchemaException' );
$collector->acceptForeignKey($this->getTableMock(), $this->getStubKeyConstraint(''));
}
}
......@@ -7,7 +7,7 @@ use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaConfig;
use Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets;
class RemoveNamespacedAssetsTest extends \PHPUnit_Framework_TestCase
class RemoveNamespacedAssetsTest extends \PHPUnit\Framework\TestCase
{
/**
* @group DBAL-204
......
......@@ -4,7 +4,7 @@ namespace Doctrine\Tests\DBAL\Schema\Visitor;
use Doctrine\DBAL\Schema\Schema;
class SchemaSqlCollectorTest extends \PHPUnit_Framework_TestCase
class SchemaSqlCollectorTest extends \PHPUnit\Framework\TestCase
{
public function testCreateSchema()
{
......
......@@ -22,7 +22,7 @@ namespace Doctrine\Tests\DBAL\Sharding;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Sharding\ShardChoser\MultiTenantShardChoser;
class PoolingShardConnectionTest extends \PHPUnit_Framework_TestCase
class PoolingShardConnectionTest extends \PHPUnit\Framework\TestCase
{
public function testConnect()
{
......@@ -60,7 +60,7 @@ class PoolingShardConnectionTest extends \PHPUnit_Framework_TestCase
public function testNoGlobalServerException()
{
$this->setExpectedException('InvalidArgumentException', "Connection Parameters require 'global' and 'shards' configurations.");
$this->expectException('InvalidArgumentException', "Connection Parameters require 'global' and 'shards' configurations.");
DriverManager::getConnection(array(
'wrapperClass' => 'Doctrine\DBAL\Sharding\PoolingShardConnection',
......@@ -75,7 +75,7 @@ class PoolingShardConnectionTest extends \PHPUnit_Framework_TestCase
public function testNoShardsServersException()
{
$this->setExpectedException('InvalidArgumentException', "Connection Parameters require 'global' and 'shards' configurations.");
$this->expectException('InvalidArgumentException', "Connection Parameters require 'global' and 'shards' configurations.");
DriverManager::getConnection(array(
'wrapperClass' => 'Doctrine\DBAL\Sharding\PoolingShardConnection',
......@@ -87,7 +87,7 @@ class PoolingShardConnectionTest extends \PHPUnit_Framework_TestCase
public function testNoShardsChoserException()
{
$this->setExpectedException('InvalidArgumentException', "Missing Shard Choser configuration 'shardChoser'");
$this->expectException('InvalidArgumentException', "Missing Shard Choser configuration 'shardChoser'");
DriverManager::getConnection(array(
'wrapperClass' => 'Doctrine\DBAL\Sharding\PoolingShardConnection',
......@@ -102,7 +102,7 @@ class PoolingShardConnectionTest extends \PHPUnit_Framework_TestCase
public function testShardChoserWrongInstance()
{
$this->setExpectedException('InvalidArgumentException', "The 'shardChoser' configuration is not a valid instance of Doctrine\DBAL\Sharding\ShardChoser\ShardChoser");
$this->expectException('InvalidArgumentException', "The 'shardChoser' configuration is not a valid instance of Doctrine\DBAL\Sharding\ShardChoser\ShardChoser");
DriverManager::getConnection(array(
'wrapperClass' => 'Doctrine\DBAL\Sharding\PoolingShardConnection',
......@@ -118,7 +118,7 @@ class PoolingShardConnectionTest extends \PHPUnit_Framework_TestCase
public function testShardNonNumericId()
{
$this->setExpectedException('InvalidArgumentException', "Shard Id has to be a non-negative number.");
$this->expectException('InvalidArgumentException', "Shard Id has to be a non-negative number.");
DriverManager::getConnection(array(
'wrapperClass' => 'Doctrine\DBAL\Sharding\PoolingShardConnection',
......@@ -133,7 +133,7 @@ class PoolingShardConnectionTest extends \PHPUnit_Framework_TestCase
public function testShardMissingId()
{
$this->setExpectedException('InvalidArgumentException', "Missing 'id' for one configured shard. Please specify a unique shard-id.");
$this->expectException('InvalidArgumentException', "Missing 'id' for one configured shard. Please specify a unique shard-id.");
DriverManager::getConnection(array(
'wrapperClass' => 'Doctrine\DBAL\Sharding\PoolingShardConnection',
......@@ -148,7 +148,7 @@ class PoolingShardConnectionTest extends \PHPUnit_Framework_TestCase
public function testDuplicateShardId()
{
$this->setExpectedException('InvalidArgumentException', "Shard 1 is duplicated in the configuration.");
$this->expectException('InvalidArgumentException', "Shard 1 is duplicated in the configuration.");
DriverManager::getConnection(array(
'wrapperClass' => 'Doctrine\DBAL\Sharding\PoolingShardConnection',
......@@ -176,7 +176,7 @@ class PoolingShardConnectionTest extends \PHPUnit_Framework_TestCase
$conn->beginTransaction();
$this->setExpectedException('Doctrine\DBAL\Sharding\ShardingException', 'Cannot switch shard when transaction is active.');
$this->expectException('Doctrine\DBAL\Sharding\ShardingException', 'Cannot switch shard when transaction is active.');
$conn->connect(1);
}
......
......@@ -20,7 +20,7 @@ namespace Doctrine\Tests\DBAL\Sharding;
use Doctrine\DBAL\Sharding\PoolingShardManager;
class PoolingShardManagerTest extends \PHPUnit_Framework_TestCase
class PoolingShardManagerTest extends \PHPUnit\Framework\TestCase
{
private function createConnectionMock()
{
......
......@@ -6,7 +6,7 @@ use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Sharding\SQLAzure\SQLAzureShardManager;
abstract class AbstractTestCase extends \PHPUnit_Framework_TestCase
abstract class AbstractTestCase extends \PHPUnit\Framework\TestCase
{
protected $conn;
protected $sm;
......
......@@ -23,7 +23,7 @@ use Doctrine\DBAL\Platforms\SQLAzurePlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Sharding\SQLAzure\Schema\MultiTenantVisitor;
class MultiTenantVisitorTest extends \PHPUnit_Framework_TestCase
class MultiTenantVisitorTest extends \PHPUnit\Framework\TestCase
{
public function testMultiTenantPrimaryKey()
{
......
......@@ -4,11 +4,11 @@ namespace Doctrine\Tests\DBAL\Sharding\SQLAzure;
use Doctrine\DBAL\Sharding\SQLAzure\SQLAzureShardManager;
class SQLAzureShardManagerTest extends \PHPUnit_Framework_TestCase
class SQLAzureShardManagerTest extends \PHPUnit\Framework\TestCase
{
public function testNoFederationName()
{
$this->setExpectedException('Doctrine\DBAL\Sharding\ShardingException', 'SQLAzure requires a federation name to be set during sharding configuration.');
$this->expectException('Doctrine\DBAL\Sharding\ShardingException', 'SQLAzure requires a federation name to be set during sharding configuration.');
$conn = $this->createConnection(array('sharding' => array('distributionKey' => 'abc', 'distributionType' => 'integer')));
$sm = new SQLAzureShardManager($conn);
......@@ -16,7 +16,7 @@ class SQLAzureShardManagerTest extends \PHPUnit_Framework_TestCase
public function testNoDistributionKey()
{
$this->setExpectedException('Doctrine\DBAL\Sharding\ShardingException', 'SQLAzure requires a distribution key to be set during sharding configuration.');
$this->expectException('Doctrine\DBAL\Sharding\ShardingException', 'SQLAzure requires a distribution key to be set during sharding configuration.');
$conn = $this->createConnection(array('sharding' => array('federationName' => 'abc', 'distributionType' => 'integer')));
$sm = new SQLAzureShardManager($conn);
......@@ -24,7 +24,7 @@ class SQLAzureShardManagerTest extends \PHPUnit_Framework_TestCase
public function testNoDistributionType()
{
$this->setExpectedException('Doctrine\DBAL\Sharding\ShardingException');
$this->expectException('Doctrine\DBAL\Sharding\ShardingException');
$conn = $this->createConnection(array('sharding' => array('federationName' => 'abc', 'distributionKey' => 'foo')));
$sm = new SQLAzureShardManager($conn);
......@@ -43,7 +43,7 @@ class SQLAzureShardManagerTest extends \PHPUnit_Framework_TestCase
$conn = $this->createConnection(array('sharding' => array('federationName' => 'abc', 'distributionKey' => 'foo', 'distributionType' => 'integer')));
$conn->expects($this->at(1))->method('isTransactionActive')->will($this->returnValue(true));
$this->setExpectedException('Doctrine\DBAL\Sharding\ShardingException', 'Cannot switch shard during an active transaction.');
$this->expectException('Doctrine\DBAL\Sharding\ShardingException', 'Cannot switch shard during an active transaction.');
$sm = new SQLAzureShardManager($conn);
$sm->selectGlobal();
......@@ -64,7 +64,7 @@ class SQLAzureShardManagerTest extends \PHPUnit_Framework_TestCase
$conn = $this->createConnection(array('sharding' => array('federationName' => 'abc', 'distributionKey' => 'foo', 'distributionType' => 'integer')));
$conn->expects($this->at(1))->method('isTransactionActive')->will($this->returnValue(true));
$this->setExpectedException('Doctrine\DBAL\Sharding\ShardingException', 'Cannot switch shard during an active transaction.');
$this->expectException('Doctrine\DBAL\Sharding\ShardingException', 'Cannot switch shard during an active transaction.');
$sm = new SQLAzureShardManager($conn);
$sm->selectShard(1234);
......@@ -77,7 +77,7 @@ class SQLAzureShardManagerTest extends \PHPUnit_Framework_TestCase
$conn = $this->createConnection(array('sharding' => array('federationName' => 'abc', 'distributionKey' => 'foo', 'distributionType' => 'integer')));
$conn->expects($this->at(1))->method('isTransactionActive')->will($this->returnValue(false));
$this->setExpectedException('Doctrine\DBAL\Sharding\ShardingException', 'You have to specify a string or integer as shard distribution value.');
$this->expectException('Doctrine\DBAL\Sharding\ShardingException', 'You have to specify a string or integer as shard distribution value.');
$sm = new SQLAzureShardManager($conn);
$sm->selectShard(null);
......
......@@ -21,7 +21,7 @@ namespace Doctrine\Tests\DBAL\Sharding\ShardChoser;
use Doctrine\DBAL\Sharding\ShardChoser\MultiTenantShardChoser;
class MultiTenantShardChoserTest extends \PHPUnit_Framework_TestCase
class MultiTenantShardChoserTest extends \PHPUnit\Framework\TestCase
{
public function testPickShard()
{
......
......@@ -7,7 +7,7 @@ use Doctrine\DBAL\Tools\Console\ConsoleRunner;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
class RunSqlCommandTest extends \PHPUnit_Framework_TestCase
class RunSqlCommandTest extends \PHPUnit\Framework\TestCase
{
/** @var CommandTester */
private $commandTester;
......
......@@ -40,7 +40,7 @@ class ArrayTest extends \Doctrine\Tests\DbalTestCase
public function testConversionFailure()
{
error_reporting( (E_ALL | E_STRICT) - \E_NOTICE );
$this->setExpectedException('Doctrine\DBAL\Types\ConversionException');
$this->expectException('Doctrine\DBAL\Types\ConversionException');
$this->_type->convertToPHPValue('abcdefg', $this->_platform);
}
......
......@@ -3,9 +3,8 @@
namespace Doctrine\Tests\DBAL\Types;
use Doctrine\Tests\DBAL\Mocks\MockPlatform;
use PHPUnit_Framework_TestCase;
abstract class BaseDateTypeTestCase extends PHPUnit_Framework_TestCase
abstract class BaseDateTypeTestCase extends \PHPUnit\Framework\TestCase
{
/**
* @var MockPlatform
......@@ -53,7 +52,7 @@ abstract class BaseDateTypeTestCase extends PHPUnit_Framework_TestCase
*/
public function testInvalidTypeConversionToDatabaseValue($value)
{
$this->setExpectedException('Doctrine\DBAL\Types\ConversionException');
$this->expectException('Doctrine\DBAL\Types\ConversionException');
$this->type->convertToDatabaseValue($value, $this->platform);
}
......
......@@ -3,9 +3,8 @@
namespace Doctrine\Tests\DBAL\Types;
use Doctrine\DBAL\Types\ConversionException;
use PHPUnit_Framework_TestCase;
class ConversionExceptionTest extends PHPUnit_Framework_TestCase
class ConversionExceptionTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider scalarsProvider
......
......@@ -7,7 +7,7 @@ use Doctrine\DBAL\Types\ConversionException;
use Doctrine\DBAL\Types\DateImmutableType;
use Doctrine\DBAL\Types\Type;
class DateImmutableTypeTest extends \PHPUnit_Framework_TestCase
class DateImmutableTypeTest extends \PHPUnit\Framework\TestCase
{
/**
* @var \Doctrine\DBAL\Platforms\AbstractPlatform|\Prophecy\Prophecy\ObjectProphecy
......
......@@ -47,7 +47,7 @@ class DateIntervalTest extends \Doctrine\Tests\DbalTestCase
public function testInvalidDateIntervalFormatConversion()
{
$this->setExpectedException('Doctrine\DBAL\Types\ConversionException');
$this->expectException('Doctrine\DBAL\Types\ConversionException');
$this->type->convertToPHPValue('abcdefg', $this->platform);
}
......@@ -71,7 +71,7 @@ class DateIntervalTest extends \Doctrine\Tests\DbalTestCase
*/
public function testInvalidTypeConversionToDatabaseValue($value)
{
$this->setExpectedException('Doctrine\DBAL\Types\ConversionException');
$this->expectException('Doctrine\DBAL\Types\ConversionException');
$this->type->convertToDatabaseValue($value, $this->platform);
}
......
......@@ -47,7 +47,7 @@ class DateTest extends BaseDateTypeTestCase
public function testInvalidDateFormatConversion()
{
$this->setExpectedException('Doctrine\DBAL\Types\ConversionException');
$this->expectException('Doctrine\DBAL\Types\ConversionException');
$this->type->convertToPHPValue('abcdefg', $this->platform);
}
}
......@@ -7,7 +7,7 @@ use Doctrine\DBAL\Types\ConversionException;
use Doctrine\DBAL\Types\DateTimeImmutableType;
use Doctrine\DBAL\Types\Type;
class DateTimeImmutableTypeTest extends \PHPUnit_Framework_TestCase
class DateTimeImmutableTypeTest extends \PHPUnit\Framework\TestCase
{
/**
* @var \Doctrine\DBAL\Platforms\AbstractPlatform|\Prophecy\Prophecy\ObjectProphecy
......
......@@ -36,7 +36,7 @@ class DateTimeTest extends BaseDateTypeTestCase
public function testInvalidDateTimeFormatConversion()
{
$this->setExpectedException('Doctrine\DBAL\Types\ConversionException');
$this->expectException('Doctrine\DBAL\Types\ConversionException');
$this->type->convertToPHPValue('abcdefg', $this->platform);
}
......
......@@ -7,7 +7,7 @@ use Doctrine\DBAL\Types\ConversionException;
use Doctrine\DBAL\Types\DateTimeTzImmutableType;
use Doctrine\DBAL\Types\Type;
class DateTimeTzImmutableTypeTest extends \PHPUnit_Framework_TestCase
class DateTimeTzImmutableTypeTest extends \PHPUnit\Framework\TestCase
{
/**
* @var \Doctrine\DBAL\Platforms\AbstractPlatform|\Prophecy\Prophecy\ObjectProphecy
......
......@@ -36,7 +36,7 @@ class DateTimeTzTest extends BaseDateTypeTestCase
public function testInvalidDateFormatConversion()
{
$this->setExpectedException('Doctrine\DBAL\Types\ConversionException');
$this->expectException('Doctrine\DBAL\Types\ConversionException');
$this->type->convertToPHPValue('abcdefg', $this->platform);
}
}
......@@ -63,7 +63,7 @@ class JsonTest extends \Doctrine\Tests\DbalTestCase
/** @dataProvider providerFailure */
public function testConversionFailure($data)
{
$this->setExpectedException('Doctrine\DBAL\Types\ConversionException');
$this->expectException('Doctrine\DBAL\Types\ConversionException');
$this->type->convertToPHPValue($data, $this->platform);
}
......
......@@ -35,7 +35,7 @@ class ObjectTest extends \Doctrine\Tests\DbalTestCase
public function testConversionFailure()
{
error_reporting( (E_ALL | E_STRICT) - \E_NOTICE );
$this->setExpectedException('Doctrine\DBAL\Types\ConversionException');
$this->expectException('Doctrine\DBAL\Types\ConversionException');
$this->_type->convertToPHPValue('abcdefg', $this->_platform);
}
......
......@@ -7,7 +7,7 @@ use Doctrine\DBAL\Types\ConversionException;
use Doctrine\DBAL\Types\TimeImmutableType;
use Doctrine\DBAL\Types\Type;
class TimeImmutableTypeTest extends \PHPUnit_Framework_TestCase
class TimeImmutableTypeTest extends \PHPUnit\Framework\TestCase
{
/**
* @var \Doctrine\DBAL\Platforms\AbstractPlatform|\Prophecy\Prophecy\ObjectProphecy
......
......@@ -31,7 +31,7 @@ class TimeTest extends BaseDateTypeTestCase
public function testInvalidTimeFormatConversion()
{
$this->setExpectedException('Doctrine\DBAL\Types\ConversionException');
$this->expectException('Doctrine\DBAL\Types\ConversionException');
$this->type->convertToPHPValue('abcdefg', $this->platform);
}
}
......@@ -7,7 +7,7 @@ use Doctrine\DBAL\Types\ConversionException;
use Doctrine\DBAL\Types\VarDateTimeImmutableType;
use Doctrine\DBAL\Types\Type;
class VarDateTimeImmutableTypeTest extends \PHPUnit_Framework_TestCase
class VarDateTimeImmutableTypeTest extends \PHPUnit\Framework\TestCase
{
/**
* @var \Doctrine\DBAL\Platforms\AbstractPlatform|\Prophecy\Prophecy\ObjectProphecy
......
......@@ -41,7 +41,7 @@ class VarDateTimeTest extends \Doctrine\Tests\DbalTestCase
public function testInvalidDateTimeFormatConversion()
{
$this->setExpectedException('Doctrine\DBAL\Types\ConversionException');
$this->expectException('Doctrine\DBAL\Types\ConversionException');
$this->_type->convertToPHPValue('abcdefg', $this->_platform);
}
......
......@@ -47,10 +47,10 @@ class DbalFunctionalTestCase extends DbalTestCase
}
}
protected function onNotSuccessfulTest($e)
protected function onNotSuccessfulTest(\Throwable $t)
{
if ($e instanceof \PHPUnit_Framework_AssertionFailedError) {
throw $e;
if ($t instanceof \PHPUnit\Framework\AssertionFailedError) {
throw $t;
}
if(isset($this->_sqlLoggerStack->queries) && count($this->_sqlLoggerStack->queries)) {
......@@ -70,7 +70,7 @@ class DbalFunctionalTestCase extends DbalTestCase
$i--;
}
$trace = $e->getTrace();
$trace = $t->getTrace();
$traceMsg = "";
foreach($trace as $part) {
if(isset($part['file'])) {
......@@ -83,10 +83,10 @@ class DbalFunctionalTestCase extends DbalTestCase
}
}
$message = "[".get_class($e)."] ".$e->getMessage().PHP_EOL.PHP_EOL."With queries:".PHP_EOL.$queries.PHP_EOL."Trace:".PHP_EOL.$traceMsg;
$message = "[".get_class($t)."] ".$t->getMessage().PHP_EOL.PHP_EOL."With queries:".PHP_EOL.$queries.PHP_EOL."Trace:".PHP_EOL.$traceMsg;
throw new \Exception($message, (int)$e->getCode(), $e);
throw new \Exception($message, (int)$t->getCode(), $t);
}
throw $e;
throw $t;
}
}
......@@ -7,14 +7,14 @@ namespace Doctrine\Tests;
*
* @author Bill Schaller
*/
class DbalPerformanceTestListener extends \PHPUnit_Framework_BaseTestListener
class DbalPerformanceTestListener extends \PHPUnit\Framework\BaseTestListener
{
private $timings = [];
/**
* {@inheritdoc}
*/
public function endTest(\PHPUnit_Framework_Test $test, $time)
public function endTest(\PHPUnit\Framework\Test $test, $time)
{
// This listener only applies to performance tests.
if ($test instanceof \Doctrine\Tests\DbalPerformanceTestCase)
......
......@@ -5,6 +5,6 @@ namespace Doctrine\Tests;
/**
* Base testcase class for all dbal testcases.
*/
abstract class DbalTestCase extends \PHPUnit_Framework_TestCase
abstract class DbalTestCase extends \PHPUnit\Framework\TestCase
{
}
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
bootstrap="../../vendor/autoload.php"
verbose="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
>
<php>
<ini name="error_reporting" value="-1" />
......@@ -35,4 +37,3 @@
</exclude>
</groups>
</phpunit>
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
bootstrap="../../vendor/autoload.php"
verbose="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
>
<php>
<ini name="error_reporting" value="-1" />
......@@ -35,4 +37,3 @@
</exclude>
</groups>
</phpunit>
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
bootstrap="../../vendor/autoload.php"
verbose="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
>
<php>
<ini name="error_reporting" value="-1" />
......@@ -35,4 +37,3 @@
</exclude>
</groups>
</phpunit>
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
bootstrap="../../vendor/autoload.php"
verbose="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
>
<php>
<ini name="error_reporting" value="-1" />
......
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
bootstrap="../../vendor/autoload.php"
verbose="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
>
<php>
<ini name="error_reporting" value="-1" />
......@@ -14,11 +16,13 @@
<directory>../Doctrine/Tests/DBAL</directory>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<whitelist>
<directory suffix=".php">./../../lib/Doctrine</directory>
</whitelist>
</filter>
<groups>
<exclude>
<group>performance</group>
......
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