summaryrefslogtreecommitdiff
path: root/tests/units/Base.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-11-14 22:44:25 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-11-14 22:44:25 -0500
commitb081288188bb1744c9d7bd075aa5936e0ccbb9c4 (patch)
tree68008e35eb129f74b9b2a49f6f6076ed02b601c6 /tests/units/Base.php
parent1487cb27634161ef558c367150213bc7077e4198 (diff)
Use Pimple instead of Core\Registry and add Monolog for logging
Diffstat (limited to 'tests/units/Base.php')
-rw-r--r--tests/units/Base.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/units/Base.php b/tests/units/Base.php
index cb56060e..27960610 100644
--- a/tests/units/Base.php
+++ b/tests/units/Base.php
@@ -3,19 +3,12 @@
require __DIR__.'/../../vendor/autoload.php';
require __DIR__.'/../../app/constants.php';
-use Core\Loader;
-use Core\Registry;
-
date_default_timezone_set('UTC');
abstract class Base extends PHPUnit_Framework_TestCase
{
public function setUp()
{
- $this->registry = new Registry;
- $this->registry->db = function() { return setup_db(); };
- $this->registry->event = function() { return setup_events(); };
-
if (DB_DRIVER === 'mysql') {
$pdo = new PDO('mysql:host='.DB_HOSTNAME, DB_USERNAME, DB_PASSWORD);
$pdo->exec('DROP DATABASE '.DB_NAME);
@@ -28,10 +21,14 @@ abstract class Base extends PHPUnit_Framework_TestCase
$pdo->exec('CREATE DATABASE '.DB_NAME.' WITH OWNER '.DB_USERNAME);
$pdo = null;
}
+
+ $this->container = new Pimple\Container;
+ $this->container->register(new ServiceProvider\Database);
+ $this->container->register(new ServiceProvider\Event);
}
public function tearDown()
{
- $this->registry->shared('db')->closeConnection();
+ $this->container['db']->closeConnection();
}
}