Make unit tests use new configuration constructor

This commit is contained in:
Christian Schorn
2012-10-31 18:21:52 +01:00
parent 3400c29a0d
commit 655ee6b85a

View File

@@ -7,6 +7,7 @@ use Gitter\Client;
class InterfaceTest extends WebTestCase class InterfaceTest extends WebTestCase
{ {
protected static $tmpdir; protected static $tmpdir;
protected static $git_path;
public static function setUpBeforeClass() public static function setUpBeforeClass()
{ {
@@ -31,6 +32,8 @@ class InterfaceTest extends WebTestCase
$options['hidden'] = array(self::$tmpdir . '/hiddenrepo'); $options['hidden'] = array(self::$tmpdir . '/hiddenrepo');
$git = new Client($options); $git = new Client($options);
self::$git_path = $options['path'];
// GitTest repository fixture // GitTest repository fixture
$git->createRepository(self::$tmpdir . 'GitTest'); $git->createRepository(self::$tmpdir . 'GitTest');
$repository = $git->getRepository(self::$tmpdir . 'GitTest'); $repository = $git->getRepository(self::$tmpdir . 'GitTest');
@@ -61,9 +64,16 @@ class InterfaceTest extends WebTestCase
public function createApplication() public function createApplication()
{ {
$config = new \GitList\Config(array(
'git' => array(
'client' => self::$git_path,
'repositories' => self::$tmpdir,
),
'app' => array(
'debug' => true,
),
));
$app = require 'boot.php'; $app = require 'boot.php';
$app['debug'] = true;
$app['git.repos'] = self::$tmpdir;
return $app; return $app;
} }