) */ public function testMissingCLIEnvironment() { $_SERVER['argc'] = 1; file_put_contents('/tmp/pickles.php', ' [ "local" => "127.0.0.1", "production" => "123.456.798.0", ], ]; '); $config = new Pickles\Config('/tmp/pickles.php'); } /** * @expectedException Exception * @expectedExceptionMessage You must pass an environment (e.g. php script.php ) */ public function testCLIEnvironmentMissingParameter() { $_SERVER['argc'] = 1; file_put_contents('/tmp/pickles.php', ' [ "local" => "127.0.0.1", "production" => "123.456.798.0", ], ]; '); $config = new Pickles\Config('/tmp/pickles.php'); } public function testCLIEnvironment() { $_SERVER['argc'] = 2; $_SERVER['argv'][1] = 'local'; file_put_contents('/tmp/pickles.php', ' [ "local" => "127.0.0.1", "production" => "123.456.798.0", ], ]; '); $config = new Pickles\Config('/tmp/pickles.php'); $this->assertEquals('local', $config['environment']); } }