コード例 #1
0
ファイル: Feed.php プロジェクト: karnurik/zf2-turtorial
 /**
  * Creates a new Zend\Feed\Writer\Deleted data container for use. This is NOT
  * added to the current feed automatically, but is necessary to create a
  * container with some initial values preset based on the current feed data.
  *
  * @return Deleted
  */
 public function createTombstone()
 {
     $deleted = new Deleted();
     if ($this->getEncoding()) {
         $deleted->setEncoding($this->getEncoding());
     }
     $deleted->setType($this->getType());
     return $deleted;
 }
コード例 #2
0
ファイル: DeletedTest.php プロジェクト: nieldm/zf2
 public function testFluentInterface()
 {
     $entry = new Writer\Deleted();
     $result = $entry->setType('type')->setBy(array('name' => 'foo'))->setComment('comment')->setEncoding('utf-8')->setReference('foo')->setWhen(null);
     $this->assertSame($result, $entry);
 }
コード例 #3
0
ファイル: DeletedTest.php プロジェクト: bradley-holt/zf2
 public function testAddByThrowsExceptionIfNameOmittedFromArray()
 {
     $entry = new Writer\Deleted();
     try {
         $entry->setBy(array('uri' => 'notauri'));
         $this->fail();
     } catch (Writer\Exception $e) {
     }
 }
コード例 #4
0
ファイル: DeletedTest.php プロジェクト: rodriquelca/zf2
 /**
  * @covers Zend\Feed\Writer\Deleted::getType
  * @covers Zend\Feed\Writer\Deleted::setType
  */
 public function testType()
 {
     $entry = new Writer\Deleted();
     $type = $entry->getType();
     $this->assertNull($type);
     $entry->setType('atom');
     $this->assertEquals('atom', $entry->getType());
 }