szurubooru/tests/AbstractDatabaseTestCase.php

28 lines
719 B
PHP
Raw Normal View History

<?php
namespace Szurubooru\Tests;
2014-09-01 20:51:59 +02:00
abstract class AbstractDatabaseTestCase extends \Szurubooru\Tests\AbstractTestCase
{
2014-08-30 17:10:45 +02:00
protected $databaseConnection;
protected $upgradeService;
public function setUp()
{
$host = 'localhost';
$port = 27017;
$database = 'test';
2014-09-10 17:41:47 +02:00
$config = $this->mockConfig();
$config->set('database/host', 'localhost');
$config->set('database/port', '27017');
$config->set('database/name', 'test');
2014-08-30 17:10:45 +02:00
$this->databaseConnection = new \Szurubooru\DatabaseConnection($config);
$this->upgradeService = new \Szurubooru\UpgradeService($this->databaseConnection);
$this->upgradeService->prepareForUsage();
}
public function tearDown()
{
$this->upgradeService->removeAllData();
}
}