Beispiel #1
0
 /**
  * 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;
 }
Beispiel #2
0
 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);
 }
Beispiel #3
0
 public function testAddByThrowsExceptionIfNameOmittedFromArray()
 {
     $entry = new Writer\Deleted();
     try {
         $entry->setBy(array('uri' => 'notauri'));
         $this->fail();
     } catch (Writer\Exception $e) {
     }
 }
Beispiel #4
0
 /**
  * @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());
 }