コード例 #1
0
ファイル: beehubTest.php プロジェクト: niekbosch/BeeHub
 public function testChangeConfigField()
 {
     $config = \BeeHub::config();
     $section = 'test_section';
     $field = 'test_field';
     // Make sure the new value is not the same as the previous value
     if (isset($config[$section]) && isset($config[$section][$field])) {
         $newValue = strval($config[$section][$field]) . '!';
     } else {
         $newValue = 'qwerty';
     }
     \BeeHub::changeConfigField($section, $field, $newValue);
     $changedConfig = \BeeHub::config();
     $this->assertSame($newValue, $changedConfig[$section][$field]);
 }
コード例 #2
0
function loadTestConfig()
{
    $configFile = \dirname(__FILE__) . \DIRECTORY_SEPARATOR . 'config.ini';
    if (!\file_exists($configFile)) {
        print 'No configuration file exists. Please copy ' . \dirname(__DIR__) . \DIRECTORY_SEPARATOR . 'config_example.ini to ' . $configFile . " and edit it to set the right configuration options\n";
        die(1);
    }
    \BeeHub::loadConfig($configFile);
    \BeeHub::changeConfigField('namespace', 'admin_group', '/system/groups/admin');
}