Пример #1
0
 /**
  * Test dump config file
  */
 public function testDump()
 {
     Config::load(self::$fixtures . '/Engine/PhpConfig/base_config.php');
     $tmpFile = tempnam(sys_get_temp_dir(), 'TestConfigure');
     $this->assertFalse(Config::dump($tmpFile, 'not_exists_engine'));
     $this->assertTrue(Config::dump($tmpFile));
     Config::load($tmpFile, 'default', false);
     $this->assertEquals(Config::get('key2.sub-key1.sub-sub-key2'), 'val2');
 }
Пример #2
0
 /**
  * Test PhpConfig dump
  */
 public function testDump()
 {
     Config::load(self::$fixtures . '/Engine/PhpConfig/base_config.php');
     $filename = sprintf('/tmp/%s/config.php', uniqid());
     $this->assertTrue(Config::dump($filename));
     Config::load($filename, 'default', false);
     $this->assertEquals(Config::get('key2.sub-key1.sub-sub-key2'), 'val2');
     chmod($filename, 0400);
     $this->setExpectedExceptionRegExp('Rad\\Configure\\Exception', sprintf('/File "%s" is not writable/', preg_quote($filename, '/')));
     Config::dump($filename);
 }