Пример #1
0
 public function testPublishPackageMainWithSidebars()
 {
     $this->saveNewsItem(self::TEXT_XML);
     $picture = $this->saveNewsItem(self::PICTURE_XML);
     $xml = simplexml_load_file(APPLICATION_PATH . '/../tests/fixtures/' . self::PACKAGE_MAIN_SIDEBARS_XML);
     $item = PackageItem::createFromXml($xml->itemSet->packageItem);
     $feed = new TestFeed();
     $item->setFeed($feed);
     $picture->setFeed($feed);
     $this->service->publish($item);
     $this->assertTrue($item->isPublished());
     $articles = \Article::GetArticles();
     $this->assertEquals(1, count($articles));
     $main = array_pop($articles);
     $this->assertEquals('S&P piles pressure on Franco-German EU budget plan', $main->getTitle());
     $images = \ArticleImage::GetImagesByArticleNumber($main->getArticleNumber());
     $this->assertEquals(1, count($images));
 }