mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-22 15:13:59 -06:00
Updated to phpunit 7 and dropped dbunit dependency
This commit is contained in:
parent
6cf0155417
commit
1b2a0820e5
@ -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",
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user