Fixed config loading

This commit is contained in:
Josh Sherman 2014-10-02 17:34:25 -04:00
parent df98b99440
commit a41ee7c2d2

View file

@ -2,19 +2,34 @@
class CacheTest extends PHPUnit_Framework_TestCase class CacheTest extends PHPUnit_Framework_TestCase
{ {
private $config;
private $cache; private $cache;
public function setUp() public function setUp()
{ {
$this->config = Pickles\Config::getInstance(); $_SERVER['REQUEST_METHOD'] = 'GET';
$this->config->data['pickles']['cache'] = 'mc'; $_SERVER['SERVER_NAME'] = '127.0.0.1';
$this->config->data['datasources']['mc'] = [
'type' => 'memcache', file_put_contents('/tmp/pickles.php', '<?php
'hostname' => 'localhost', $config = [
'port' => 11211, "environments" => [
'namespace' => 'ns', "local" => "127.0.0.1",
"production" => "123.456.789.0",
],
"pickles" => [
"cache" => "mc",
],
"datasources" => [
"mc" => [
"type" => "memcache",
"hostname" => "localhost",
"port" => 11211,
"namespace" => "ns",
],
],
]; ];
');
Pickles\Config::getInstance('/tmp/pickles.php');
$this->cache = Pickles\Cache::getInstance(); $this->cache = Pickles\Cache::getInstance();
} }