Exemplo n.º 1
0
 public function testPreFill()
 {
     $app = $this->getApp();
     $this->addDefaultUser($app);
     $prefillMock = new LoripsumMock();
     $app['prefill'] = $prefillMock;
     $app['config']->set('general/changelog/enabled', true);
     $storage = new Storage($app);
     $output = $storage->prefill(['showcases']);
     $this->assertRegExp('#Added#', $output);
     $this->assertRegExp('#Done#', $output);
     $output = $storage->prefill();
     $this->assertRegExp('#Skipped#', $output);
 }
Exemplo n.º 2
0
 protected function addSomeContent()
 {
     $app = $this->getApp();
     $app['request'] = Request::create('/');
     $app['config']->set('taxonomy/categories/options', ['news']);
     $prefillMock = new LoripsumMock();
     $app['prefill'] = $prefillMock;
     $storage = new Storage($app);
     $storage->prefill(['showcases', 'entries', 'pages']);
     // We also set some relations between showcases and entries
     $showcases = $storage->getContent('showcases');
     $randEntries = $storage->getContent('entries/random/2');
     foreach ($showcases as $show) {
         foreach ($randEntries as $key => $entry) {
             $show->setRelation('entries', $key);
             $storage->saveContent($show);
         }
     }
 }
Exemplo n.º 3
0
 protected function addSomeContent()
 {
     $app = $this->getApp();
     $this->addDefaultUser($app);
     $app['config']->set('taxonomy/categories/options', ['news']);
     $prefillMock = new LoripsumMock();
     $app['prefill'] = $prefillMock;
     $storage = new Storage($app);
     $storage->prefill(['showcases', 'pages']);
 }
Exemplo n.º 4
0
 protected function addSomeContent()
 {
     $app = $this->getApp();
     $app['config']->set('taxonomy/categories/options', array('news'));
     $prefillMock = new LoripsumMock();
     $app['prefill'] = $prefillMock;
     $storage = new Storage($app);
     $storage->prefill(array('showcases'));
 }