public function testCacheInvalid() { file_put_contents(__DIR__ . "/tests_tmp/config", serialize("invalid")); $storage = new \FabysCore\Component\Cache\Storage\FileStorage(__DIR__ . "/tests_tmp"); $cache = new \FabysCore\Component\Cache\Cache($storage); $config = new Configuration($cache); $this->assertTrue($config->isLoaded()); $value = $config->parameter("test", "default"); $this->assertEquals("default", $value); }
/** * returns a parameter value * sets the parameter to $value if not found * * @param string $key * @param string $value * @return mixed */ public function parameter(string $key, $value = "") { return $this->config->parameter($key, $value); }