Example #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);
 }
Example #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 (array_keys($randEntries) as $key) {
             $show->setRelation('entries', $key);
             $storage->saveContent($show);
         }
     }
 }
Example #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']);
 }