Beispiel #1
0
 /**
  * _get_test_methods : list all public method for current requested ctontroller
  * @return array function name list
  */
 private function _get_test_methods()
 {
     $app = super_app::get_app();
     $methods = get_class_methods($app->router->fetch_class());
     $testMethods = array();
     foreach ($methods as $method) {
         if (substr(strtolower($method), 0, 5) == 'test_') {
             $testMethods[] = $method;
         }
     }
     return $testMethods;
 }
Beispiel #2
0
 public function test_session()
 {
     $app = super_app::get_app();
     $new_val = rand(1, 9999);
     $app->session->set('once', $new_val);
     $domain = AppServer::get_instance()->config->get('session_domain', __METHOD__);
     $test = $app->session->get('once');
     $this->_assert_true($new_val === $test && $new_val === $_SESSION[$domain]['once'], 'Run task');
 }
Beispiel #3
0
 /**
  * get_model : get instance of specified model
  * @param  string $model  model name
  * @param  mixed  $params parameter for new model ctor
  * @return object         instance of model
  */
 public function get_model($model = '', $params = null)
 {
     return super_app::get_app()->get_model($model, $params);
 }