Exemple #1
0
 protected function _test_today()
 {
     $messages = array('Testing today');
     $suite = $this;
     $o = $this->target;
     $callback = function () use($o, $suite) {
         $today = h\today();
         $suite->assert($today->check());
         $suite->_assert_equals($today->day, \date('d'));
         $suite->_assert_equals($today->month, \date('m'));
         $suite->_assert_equals($today->year, \date('Y'));
         $suite->_assert_equals($today->timestamp, \strtotime(\date('m/d/Y')));
         return $today->check();
     };
     $this->add_test($callback, $messages);
 }
Exemple #2
0
 public function __construct()
 {
     $this->_name = new h\string();
     $this->_email = new h\string();
     $this->_created = h\today();
     $this->_modified = h\today();
     parent::__construct();
 }
Exemple #3
0
 public function create_from_http_request_post_data()
 {
     $post = $this->ctrl->get_post_data();
     $stories = $this->create_bare(count($post['story_title']));
     for ($idx = 0; $idx < $stories->count(); ++$idx) {
         $stories[$idx]->title = h\string($post['story_title'][$idx]);
         $stories[$idx]->description = h\string($post['story_description'][$idx]);
         $stories[$idx]->modified = h\today();
         $this->get_resource_model()->insert($stories[$idx]);
     }
     return $stories;
 }
Exemple #4
0
 public function create_from_http_request_post_data()
 {
     $post = $this->ctrl->get_post_data();
     $accounts = $this->create_bare(count($post['account_name']));
     for ($idx = 0; $idx < $accounts->count(); ++$idx) {
         $accounts[$idx]->name = h\string($post['account_name'][$idx]);
         $accounts[$idx]->email = h\string($post['account_email'][$idx]);
         $accounts[$idx]->modified = h\today();
         $this->get_resource_model()->insert($accounts[$idx]);
     }
     return $accounts;
 }