Example #1
0
 public function testStoreUnlockedData()
 {
     $data = array('dummy' => 'dummy');
     Application::db()->store('some-data-2', array(), false);
     Application::db()->store('some-data-2', $data);
     $this->assertTrue(Application::db()->retrieve('some-data-2') == $data);
 }
Example #2
0
 public function testExecuteDatabase()
 {
     $files = new Files();
     $files->load(dirname(__FILE__) . '/data', 'page-data');
     $component = new PostDatabase();
     $component->execute($files);
     $this->assertTrue(count(Application::db()->retrieve('post_list')) > 0);
 }
Example #3
0
 /**
  * Render function.
  * @param $files array | A list of all available entries.
  * @return void
  */
 public function execute($files)
 {
     printLn('=> PageWriter.');
     $pages = Application::db()->retrieve('page_list');
     $writer = new DataWriter();
     foreach ($pages as $page) {
         $tmpl = $this->make_data($page);
         $writer->write($tmpl['slug'], 'index.html', $tmpl['html']);
     }
 }
 public function execute($files)
 {
     printLn('=> CategoryWriter.');
     $this->make_categories_directory();
     $categories = Application::db()->retrieve('categories_list');
     $writer = new DataWriter();
     foreach ($categories as $cat => $posts) {
         $tmpl = $this->make_data($cat, $posts);
         $writer->write($tmpl['slug'], 'index.html', $tmpl['html']);
     }
 }
Example #5
0
 public function testBuildComponent()
 {
     $component = new PageDatabase();
     $component->execute($this->files);
     $this->assertTrue(count(Application::db()->retrieve('page_list')) > 0);
 }