protected function createData()
 {
     $page1 = self::createPage('Page 1');
     $page2 = self::createPage('Page 2');
     $page3 = self::createPage('Page 3');
     $page4 = self::createPage('Page 4');
     $subpageA = self::createPage('Subpage A', $page2);
     self::createPage('Subpage B', $page2);
     self::createPage('Subpage C', $page2);
     $feed = new \Concrete\Core\Page\Feed();
     $feed->setHandle('blog');
     $feed->setParentID(1);
     \Database::connection()->getEntityManager()->persist($feed);
     \Database::connection()->getEntityManager()->flush();
 }
Exemplo n.º 2
0
 public function testBasicFeedSave()
 {
     $pt = \Concrete\Core\Page\Type\Type::getByHandle('another');
     $pp = \Concrete\Core\Page\Page::getByPath('/another-fun-page');
     $pf = new \Concrete\Core\Page\Feed();
     $pf->setHandle('blog');
     $pf->setPageTypeID($pt->getPageTypeID());
     $pf->setParentID($pp->getCollectionID());
     $pf->setTitle('RSS Feed');
     $pf->setDescription('My Description');
     $pf->save();
     $this->assertEquals('blog', $pf->getHandle());
     $this->assertEquals(1, $pf->getID());
     $pf->ignorePermissions();
     $pl = $pf->getPageListObject();
     $this->assertInstanceOf('\\Concrete\\Core\\Page\\PageList', $pl);
     $this->assertEquals(1, $pl->getTotalResults());
     $results = $pl->getResults();
     $this->assertEquals('Foobler', $results[0]->getCollectionName());
 }