encode() public method

public encode ( array $data )
$data array
Example #1
0
 public function testEncoding()
 {
     $formatter = new YAML();
     $data = array('name' => 'Joe', 'age' => 21, 'employed' => true);
     $content = $this->normalizeLineendings(file_get_contents(__DIR__ . '/fixtures/joe.yaml'));
     $this->assertSame($content, $formatter->encode($data));
 }