From a41ee7c2d26d2bab261b93e73e1b153d73b164db Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Thu, 2 Oct 2014 17:34:25 -0400 Subject: [PATCH] Fixed config loading --- tests/CacheTest.php | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/tests/CacheTest.php b/tests/CacheTest.php index 364d304..06cefa4 100644 --- a/tests/CacheTest.php +++ b/tests/CacheTest.php @@ -2,19 +2,34 @@ class CacheTest extends PHPUnit_Framework_TestCase { - private $config; private $cache; public function setUp() { - $this->config = Pickles\Config::getInstance(); - $this->config->data['pickles']['cache'] = 'mc'; - $this->config->data['datasources']['mc'] = [ - 'type' => 'memcache', - 'hostname' => 'localhost', - 'port' => 11211, - 'namespace' => 'ns', - ]; + $_SERVER['REQUEST_METHOD'] = 'GET'; + $_SERVER['SERVER_NAME'] = '127.0.0.1'; + + file_put_contents('/tmp/pickles.php', ' [ + "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(); }