szurubooru/tests/AbstractDatabaseTest.php

29 lines
733 B
PHP
Raw Normal View History

<?php
namespace Szurubooru\Tests;
abstract class AbstractDatabaseTest extends \PHPUnit_Framework_TestCase
{
2014-08-30 17:10:45 +02:00
protected $databaseConnection;
protected $upgradeService;
public function setUp()
{
$host = 'localhost';
$port = 27017;
$database = 'test';
2014-08-30 17:10:45 +02:00
$config = new \Szurubooru\Config();
2014-08-30 18:11:04 +02:00
$config->database = new \StdClass;
$config->database->host = 'localhost';
$config->database->port = 27017;
$config->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();
}
}