Пример #1
0
 public function testArrayOfTables()
 {
     $tb = new TomlBuilder();
     $result = $tb->addArrayTables('fruit')->addValue('name', 'apple')->addArrayTables('fruit.variety')->addValue('name', 'red delicious')->addArrayTables('fruit.variety')->addValue('name', 'granny smith')->addArrayTables('fruit')->addValue('name', 'banana')->addArrayTables('fruit.variety')->addValue('name', 'platain')->getTomlString();
     $this->assertNotNull(Toml::Parse($result));
 }
Пример #2
0
 /**
  * @expectedException \Yosymfony\Toml\Exception\DumpException
  */
 public function testTableArrayWithSomeNameOfTable()
 {
     $tb = new TomlBuilder();
     $result = $tb->addArrayTables('fruit')->addValue('name', 'apple')->addArrayTables('fruit.variety')->addValue('name', 'red delicious')->addTable('fruit.variety')->addValue('name', 'granny smith')->getTomlString();
 }