diff --git a/composer.json b/composer.json index 7e5bfc12..f57d5c34 100644 --- a/composer.json +++ b/composer.json @@ -50,9 +50,8 @@ "filp/whoops": "^2.0", "infection/infection": "^0.8.1", "phpstan/phpstan": "0.9", - "phpunit/dbunit": "^3.0", - "phpunit/phpcov": "^4.0", - "phpunit/phpunit": "^6.0", + "phpunit/phpcov": "^5.0", + "phpunit/phpunit": "^7.0", "slevomat/coding-standard": "^4.0", "squizlabs/php_codesniffer": "^3.1 <3.2", "symfony/dotenv": "^3.4", diff --git a/module/Common/test-func/DbUnit/DatabaseTestCase.php b/module/Common/test-func/DbUnit/DatabaseTestCase.php index 58a10bdc..89ee871f 100644 --- a/module/Common/test-func/DbUnit/DatabaseTestCase.php +++ b/module/Common/test-func/DbUnit/DatabaseTestCase.php @@ -3,40 +3,17 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Common\DbUnit; -use Doctrine\DBAL\Driver\PDOConnection; use Doctrine\ORM\EntityManagerInterface; -use PHPUnit\DbUnit\Database\Connection as DbConn; -use PHPUnit\DbUnit\DataSet\IDataSet as DataSet; -use PHPUnit\DbUnit\TestCase; +use PHPUnit\Framework\TestCase; abstract class DatabaseTestCase extends TestCase { - const ENTITIES_TO_EMPTY = []; + protected const ENTITIES_TO_EMPTY = []; /** * @var EntityManagerInterface */ public static $em; - /** - * @var DbConn - */ - private static $conn; - - public function getConnection(): DbConn - { - if (isset(self::$conn)) { - return self::$conn; - } - - /** @var PDOConnection $pdo */ - $pdo = static::$em->getConnection()->getWrappedConnection(); - return self::$conn = $this->createDefaultDBConnection($pdo, static::$em->getConnection()->getDatabase()); - } - - public function getDataSet(): DataSet - { - return $this->createArrayDataSet([]); - } protected function getEntityManager(): EntityManagerInterface {