public function testConfiguration () { Configuration::setOption("test", "value"); $this->assertEquals(Configuration::getOption("test"), "value"); /* Test for the default value of bool false */ $this->assertEquals(Configuration::getOption("test2"), false); /* Test for an user-specified default value */ $this->assertEquals(Configuration::getOption("test2", "default"), "default"); }
<?php namespace de\RaumZeitLabor\PartKeepr; use de\RaumZeitLabor\PartKeepr\Util\Configuration; Configuration::setOption("partkeepr.database.username", "partkeepr"); Configuration::setOption("partkeepr.database.password", "partkeepr"); Configuration::setOption("partkeepr.database.hostname", "localhost"); Configuration::setOption("partkeepr.database.dbname", "partkeepr-test"); Configuration::setOption("partkeepr.database.driver", "pdo_mysql"); ?>
<?php namespace de\RaumZeitLabor\PartKeepr; use de\RaumZeitLabor\PartKeepr\Util\Configuration; Configuration::setOption("partkeepr.database.username", "partkeepr"); Configuration::setOption("partkeepr.database.password", "partkeepr"); Configuration::setOption("partkeepr.database.hostname", "localhost"); Configuration::setOption("partkeepr.database.dbname", "partkeepr"); Configuration::setOption("partkeepr.database.driver", "pdo_mysql"); Configuration::setOption("partkeepr.database.echo_sql_log", false); Configuration::setOption("partkeepr.files.path", __DIR__."/data/files/"); Configuration::setOption("partkeepr.images.path", __DIR__."/data/images/"); Configuration::setOption("partkeepr.images.cache", Configuration::getOption("partkeepr.images.path")."cache/");