Exemplo n.º 1
0
 /**
  * testUninstall
  *
  * @since 2.2.0
  */
 public function testUninstall()
 {
     /* setup */
     $module = new Module(array('alias' => 'test'));
     $module->uninstall();
     /* result */
     Db::clearCache();
     $result = Db::forPrefixTable('modules')->where('alias', 'test')->findOne();
     /* compare */
     $this->assertFalse(is_object($result));
 }
Exemplo n.º 2
0
 /**
  * tearDownAfterClass
  *
  * @since 2.2.0
  */
 public static function tearDownAfterClass()
 {
     Db::forPrefixTable('categories')->where('alias', 'ultra')->deleteMany();
     Db::forPrefixTable('categories')->where('alias', 'lightweight')->deleteMany();
     Db::forPrefixTable('articles')->where('alias', 'cms')->deleteMany();
 }
Exemplo n.º 3
0
 /**
  * build the breadcrumb array for current content
  *
  * @since 2.1.0
  *
  * @param integer $key
  */
 private function _buildContent($key = 0)
 {
     /* join first title */
     $this->_breadcrumbArray[$key]['title'] = Db::forPrefixTable($this->_registry->get('firstTable'))->where('alias', $this->_registry->get('firstParameter'))->findOne()->title;
     /* set route if not end */
     if ($this->_registry->get('firstParameter') !== $this->_registry->get('lastParameter')) {
         $this->_breadcrumbArray[$key]['route'] = $this->_registry->get('firstParameter');
     }
     /* join second title */
     if ($this->_registry->get('secondTable')) {
         $key++;
         $this->_breadcrumbArray[$key]['title'] = Db::forPrefixTable($this->_registry->get('secondTable'))->where('alias', $this->_registry->get('secondParameter'))->findOne()->title;
         /* set route if not end */
         if ($this->_registry->get('secondParameter') !== $this->_registry->get('lastParameter')) {
             $this->_breadcrumbArray[$key]['route'] = $this->_registry->get('firstParameter') . '/' . $this->_registry->get('secondParameter');
         }
         /* join third title */
         if ($this->_registry->get('thirdTable')) {
             $key++;
             $this->_breadcrumbArray[$key]['title'] = Db::forPrefixTable($this->_registry->get('thirdTable'))->where('alias', $this->_registry->get('thirdParameter'))->findOne()->title;
         }
     }
 }
Exemplo n.º 4
0
 /**
  * testMinus
  *
  * @since 2.2.0
  */
 public function testMinus()
 {
     /* setup */
     Db::forPrefixTable('settings')->where('name', 'captcha')->findOne()->set('value', 3)->save();
     /* result */
     $result = new Captcha($this->_language);
     /* compare */
     $this->assertTrue(is_object($result));
 }
Exemplo n.º 5
0
 /**
  * init the class
  *
  * @since 2.1.0
  */
 public function init()
 {
     $this->_detect(array('query' => Request::getQuery('t'), 'session' => Request::getSession($this->_registry->get('root') . '/template'), 'contents' => $this->_registry->get('lastTable') ? Db::forPrefixTable($this->_registry->get('lastTable'))->where('id', $this->_registry->get('lastId'))->findOne()->template : null, 'settings' => Db::getSettings('template'), 'fallback' => 'default'), 'template', 'templates/{value}/index.phtml');
 }
Exemplo n.º 6
0
 /**
  * init the class
  *
  * @since 2.1.0
  */
 public function init()
 {
     $this->_detect(array('query' => Request::getQuery('l'), 'session' => Request::getSession($this->_registry->get('root') . '/language'), 'contents' => $this->_registry->get('lastTable') ? Db::forPrefixTable($this->_registry->get('lastTable'))->where('id', $this->_registry->get('lastId'))->findOne()->language : null, 'settings' => Db::getSettings('language'), 'browser' => substr(Request::getServer('HTTP_ACCEPT_LANGUAGE'), 0, 2), 'fallback' => 'en'), 'language', 'languages/{value}.json');
 }