コード例 #1
0
ファイル: WriterTestCase.php プロジェクト: seytar/psx
 public function getResultSet()
 {
     $entries = array();
     $record = new WriterTestRecord();
     $record->setId(1);
     $record->setAuthor('foo');
     $record->setTitle('bar');
     $record->setContent('foobar');
     $record->setDate(new DateTime('2012-03-11 13:37:21'));
     $entries[] = $record;
     $record = new WriterTestRecord();
     $record->setId(2);
     $record->setAuthor('foo');
     $record->setTitle('bar');
     $record->setContent('foobar');
     $record->setDate(new DateTime('2012-03-11 13:37:21'));
     $entries[] = $record;
     return new ResultSet(2, 0, 8, $entries);
 }
コード例 #2
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);
    }