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
 /**
  * @covers Zend\Feed\Writer\Deleted::getEncoding
  * @covers Zend\Feed\Writer\Deleted::setEncoding
  */
 public function testEncoding()
 {
     $entry = new Writer\Deleted();
     $encoding = $entry->getEncoding();
     $this->assertEquals('UTF-8', $encoding);
     $entry->setEncoding('ISO-8859-1');
     $this->assertEquals('ISO-8859-1', $entry->getEncoding());
     $this->setExpectedException('Zend\\Feed\\Writer\\Exception\\InvalidArgumentException', 'Invalid parameter: parameter must be a non-empty string');
     $entry->setEncoding(null);
 }