2014-08-28 10:45:55 +02:00
|
|
|
<?php
|
|
|
|
namespace Szurubooru\Tests;
|
|
|
|
|
|
|
|
abstract class AbstractDatabaseTest extends \PHPUnit_Framework_TestCase
|
|
|
|
{
|
2014-08-30 17:10:45 +02:00
|
|
|
protected $databaseConnection;
|
2014-08-28 10:45:55 +02:00
|
|
|
protected $upgradeService;
|
|
|
|
|
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
$host = 'localhost';
|
|
|
|
$port = 27017;
|
|
|
|
$database = 'test';
|
2014-08-30 17:10:45 +02:00
|
|
|
$config = new \Szurubooru\Config();
|
|
|
|
$config->databaseHost = 'localhost';
|
|
|
|
$config->databasePort = 27017;
|
|
|
|
$config->databaseName = 'test';
|
|
|
|
$this->databaseConnection = new \Szurubooru\DatabaseConnection($config);
|
|
|
|
$this->upgradeService = new \Szurubooru\UpgradeService($this->databaseConnection);
|
2014-08-28 10:45:55 +02:00
|
|
|
$this->upgradeService->prepareForUsage();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function tearDown()
|
|
|
|
{
|
|
|
|
$this->upgradeService->removeAllData();
|
|
|
|
}
|
|
|
|
}
|