コード例 #1
0
ファイル: AtomTest.php プロジェクト: seytar/psx
    public function testWriteRecord()
    {
        $record = new WriterTestRecord();
        $record->setId(1);
        $record->setAuthor('foo');
        $record->setTitle('bar');
        $record->setContent('foobar');
        $writer = new Atom();
        $actual = $writer->write($record);
        $expect = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
  <content type="application/xml">
    <record>
      <id>1</id>
      <author>foo</author>
      <title>bar</title>
      <content>foobar</content>
    </record>
  </content>
</entry>
XML;
        $this->assertXmlStringEqualsXmlString($expect, $actual);
    }