addValue() public method

Add a key-value.
public addValue ( string $key, mixed $val, string $comment = null ) : TomlBuilder
$key string
$val mixed
$comment string
return TomlBuilder
Exemplo n.º 1
0
 public function testStringEscapesSingleQuote()
 {
     $tb = new TomlBuilder();
     $result = $tb->addValue('backspace', 'This string has a \\b backspace character.')->addValue('tab', 'This string has a \\t tab character.')->addValue('newline', 'This string has a \\n new line character.')->addValue('formfeed', 'This string has a \\f form feed character.')->addValue('carriage', 'This string has a \\r carriage return character.')->addValue('quote', 'This string has a \\" quote character.')->addValue('slash', 'This string has a \\/ slash character.')->addValue('backslash', 'This string has a \\ backslash character.')->getTomlString();
     $this->assertNotNull(Toml::Parse($result));
 }
Exemplo n.º 2
0
 /**
  * @expectedException \Yosymfony\Toml\Exception\DumpException
  */
 public function testNullValue()
 {
     $tb = new TomlBuilder();
     $result = $tb->addValue('theNull', null)->getTomlString();
 }