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); }
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); }
/** * 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']); } }
public function testBuildComponent() { $component = new PageDatabase(); $component->execute($this->files); $this->assertTrue(count(Application::db()->retrieve('page_list')) > 0); }
public function testGetDefaultTemplate() { $this->assertTrue(Application::templates()->template('default') != ''); }
public function testLoadContentFiles() { $this->assertTrue(Application::files()->count() > 0); }
public function testloadSiteApplication() { $this->assertTrue(Application::config()->name() == 'simple web project'); $this->assertTrue(Application::config()->public_folder() == 'web'); $this->assertTrue(Application::config()->get("my_data") == 'stuff'); }