コード例 #1
0
ファイル: YamlTest.php プロジェクト: rafalwrzeszcz/zf2
 public function testWriteAndReadOriginalFile()
 {
     $config = new YamlConfig(__DIR__ . '/files/allsections.yaml', null, array('skip_extends' => true));
     $writer = new YamlWriter(array('config' => $config, 'filename' => $this->_tempName));
     $writer->write();
     $config = new YamlConfig($this->_tempName, null);
     $this->assertEquals('multi', $config->staging->one->two->three, var_export($config->toArray(), 1));
     $config = new YamlConfig($this->_tempName, null, array('skip_extends' => true));
     $this->assertFalse(isset($config->staging->one));
 }
コード例 #2
0
ファイル: YamlTest.php プロジェクト: hjr3/zf2
 public function testHonorsOptionsProvidedToConstructor()
 {
     $config = new YamlConfig($this->_iniFileAllSectionsConfig, 'debug', array('allow_modifications' => true, 'skip_extends' => true, 'yaml_decoder' => array($this, 'yamlDecoder'), 'foo' => 'bar'));
     $this->assertNull($config->name);
     // verifies extends were skipped
     $config->foo = 'bar';
     $this->assertEquals('bar', $config->foo);
     // verifies allows modifications
     $this->assertEquals(array($this, 'yamlDecoder'), $config->getYamlDecoder());
 }