Fixed up the config again

This commit is contained in:
Josh Sherman 2014-10-02 17:54:59 -04:00
parent c9ffe4c8bf
commit 90c4c53294

View file

@ -25,31 +25,42 @@ class ModelTest extends PHPUnit_Framework_TestCase
{ {
// Clears out the Config for ease of testing // Clears out the Config for ease of testing
Pickles\Object::$instances = []; Pickles\Object::$instances = [];
$config = Pickles\Config::getInstance();
$config->data = [ $_SERVER['REQUEST_METHOD'] = 'GET';
'pickles' => [ $_SERVER['SERVER_NAME'] = '127.0.0.1';
'datasource' => 'mysql',
'cache' => 'memcache', file_put_contents('/tmp/pickles.php', '<?php
], $config = [
'datasources' => [ "environments" => [
'mysql' => [ "local" => "127.0.0.1",
'type' => 'mysql', "production" => "123.456.789.0",
'driver' => 'pdo_mysql',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'test',
'cache' => true,
], ],
'memcache' => [ "pickles" => [
'type' => 'memcache', "namespace" => "",
'hostname' => 'localhost', "datasource" => "mysql",
'port' => 11211, "cache" => "memcache",
'namespace' => '',
], ],
], "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++) for ($i = 0; $i < 5; $i++)
{ {