Exemplo n.º 1
0
 public function appControllerLoad()
 {
     $TestModel = new TestModel();
     $list = $TestModel->getList();
     json_return($list);
     test();
 }
Exemplo n.º 2
0
 public function indexAction()
 {
     /*$this->getRequest()->widget = function(){
           echo 'call widget';
       };*/
     #DebugTools::print_r($this->getRequest());
     $test_model = new TestModel();
     $test = $test_model->getList(array('cost' => 8));
     DebugTools::print_r($test);
     /*foreach ($test as $k=>$v){
           DebugTools::print_r($v);
       }*/
     #System_Memcache::set('test1','12346',60);
     #DebugTools::print_r(System_Memcache::get('test1'));
     #$version = System_Memcache::getInstance()->getVersion();
     #DebugTools::print_r($version);
     #$stats = System_Memcache::getInstance()->getStats();
     #DebugTools::print_r($stats);
     #$server_status = System_Memcache::getInstance()->getServerStatus('127.0.0.1',11211);
     #DebugTools::print_r($server_status);
     #DebugTools::print_r(System_Memcache::getExtendedStats());
     #DebugTools::print_r($test_model->dc_close());
     /*$test = System_Mongo::getInstance()->conn()
                 ->selectDB('gamedb')
                 ->selectCollection('entity_ff14_ClassJob')
                 ->findOne(array('Key'=>intval(1)));
     
             DebugTools::print_r($test);
             $a = System_Mongo::getInstance()->close();
             DebugTools::print_r($a.'a');
     
             $test = System_Mongo::getInstance()->conn()
                 ->selectDB('gamedb')
                 ->selectCollection('entity_ff14_ClassJob')
                 ->select(array(),array(),array(),3);
     
             foreach ($test as $doc){
                 DebugTools::print_r($doc);
             }*/
     $this->getView()->assign("content", "Hello World");
     return TRUE;
 }
Exemplo n.º 3
0
 public function testGetListTestModel()
 {
     for ($i = 0; $i < 10; $i++) {
         $model = new TestModel();
         $model->title = 'title ' . $i;
         $model->description = 'A small desc ' . $i;
         $model->create();
     }
     $model->title = 'update to have 11 records and 10 head';
     $model->update();
     $m = new TestModel();
     $models = $m->getList();
     $this->assertEquals(10, count($models));
     $this->assertEquals('title 0', $models[0]->title);
     $this->assertEquals('title 5', $models[5]->title);
 }