Пример #1
0
 /**
  * @param object $contentDocument
  * @return ItemInterface[]
  */
 public function getItems($contentDocument)
 {
     $dataProvider = $this->contentProvider->getProvider($contentDocument);
     $children = $dataProvider->getChildren($contentDocument);
     $items = array();
     foreach ($children as $child) {
         $items[] = $this->itemConverter->convertContent($child);
     }
     return $items;
 }
 public function testSupportingExtractors()
 {
     $content = new \stdClass();
     $extractor = $seoAware = $this->getMock('My\\Cmf\\Bundle\\FeedBundle\\Extractor\\Item\\ExtractorInterface');
     $extractor->expects($this->once())->method('supports')->with($content)->will($this->returnValue(true));
     $extractor->expects($this->once())->method('updateMetadata')->with($content);
     $converter = new ItemConverter(array($extractor));
     $item = $converter->convertContent($content);
     $this->assertNotNull($item);
 }