From 90c4c53294b5d56b996e045bf53543c2caf79159 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Thu, 2 Oct 2014 17:54:59 -0400 Subject: [PATCH] Fixed up the config again --- tests/ModelTest.php | 55 +++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/tests/ModelTest.php b/tests/ModelTest.php index 600a73a..dbf6bcf 100644 --- a/tests/ModelTest.php +++ b/tests/ModelTest.php @@ -25,31 +25,42 @@ class ModelTest extends PHPUnit_Framework_TestCase { // Clears out the Config for ease of testing Pickles\Object::$instances = []; - $config = Pickles\Config::getInstance(); - $config->data = [ - 'pickles' => [ - 'datasource' => 'mysql', - 'cache' => 'memcache', - ], - 'datasources' => [ - 'mysql' => [ - 'type' => 'mysql', - 'driver' => 'pdo_mysql', - 'hostname' => 'localhost', - 'username' => 'root', - 'password' => '', - 'database' => 'test', - 'cache' => true, + $_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", ], - 'memcache' => [ - 'type' => 'memcache', - 'hostname' => 'localhost', - 'port' => 11211, - 'namespace' => '', + "pickles" => [ + "namespace" => "", + "datasource" => "mysql", + "cache" => "memcache", ], - ], - ]; + "datasources" => [ + "mysql" => [ + "type" => "mysql", + "driver" => "pdo_mysql", + "hostname" => "localhost", + "username" => "root", + "password" => "", + "database" => "test", + "cache" => true, + ], + "memcache" => [ + "type" => "memcache", + "hostname" => "localhost", + "port" => 11211, + "namespace" => "", + ], + ], + ]; + '); + + $config = Pickles\Config::getInstance('/tmp/pickles.php'); for ($i = 0; $i < 5; $i++) {