Exemplo n.º 1
0
 /**
  * @covers Debril\RssAtomBundle\Protocol\Parser\FeedContent::addItem
  */
 public function testAddItem()
 {
     $count = $this->object->getItemsCount();
     $ret = $this->object->addItem(new Item());
     $this->assertInstanceOf("Debril\\RssAtomBundle\\Protocol\\Parser\\FeedContent", $ret);
     $this->assertEquals($count + 1, $this->object->getItemsCount());
 }
Exemplo n.º 2
0
Arquivo: feeder.php Projeto: ajb/rfpez
 function SummariesTo(FeedText $desc, FeedContent $content, $length = 150)
 {
     if (!$desc->HasAny()) {
         foreach ($content->All() as $data) {
             if ("{$data['data']}" !== '' and $desc->IsValidType($data['type'])) {
                 if (in_array($data['type'], array('html', 'xhtml'))) {
                     $func = 'HtmlSummaryFrom';
                 } else {
                     $func = 'TextSummaryFrom';
                 }
                 $desc->Add($data['type'], $this->{$func}($data['data'], $length));
             }
         }
     }
 }