Beispiel #1
0
 public function test_setup()
 {
     //echo NumberHelper::human_size(memory_get_peak_usage()).' '.__LINE__."\n";
     $Request = new MockAkRequest();
     $Request->setReturnValue('getController', 'test');
     $Request->setReturnValue('getRelativeUrlRoot', '');
     $Request->setReturnValue('getParametersFromRequestedUrl', array('controller' => 'test'));
     $this->controller = new AkActionController();
     $this->controller->Request = $Request;
     $this->active_record_helper = $this->controller->active_record_helper;
     $this->installAndIncludeModels(array('DummyProtectedPerson', 'DummyProperty'));
     $this->controller->DummyProtectedPerson = new DummyProtectedPerson();
     $this->LuckyLuke = $this->controller->DummyProtectedPerson;
     $this->controller->DummyProtectedPerson->name = "Lucky Luke";
     $this->controller->DummyProtectedPerson->created_by = "1";
     $this->controller->DummyProtectedPerson->birthday = Ak::getDate(mktime(8, 42, 36, 3, 27, 1982));
     $this->controller->DummyProtectedPerson->save();
     $this->controller->DummyProtectedPerson->created_at = Ak::getDate(mktime(8, 42, 36, 3, 27, 1982));
     $this->controller->DummyProtectedPerson->updated_at = Ak::getDate(mktime(8, 42, 36, 3, 27, 1982));
     $this->controller->DummyProperty = new DummyProperty(array('description' => '阿尔罕布拉宫', 'details' => '阿尔罕布拉宫 <> & (阿拉伯语: الحمراء‎‎ = Al Ħamrā\'; 即"红色城堡")'));
     $this->alhambra = $this->controller->DummyProperty;
     $this->alhambra->save();
     //echo NumberHelper::human_size(memory_get_peak_usage()).' '.__LINE__."\n";
 }
Beispiel #2
0
 function test_setup()
 {
     $Request = new MockAkRequest();
     $Request->setReturnValue('getController', 'test');
     $Request->setReturnValue('getRelativeUrlRoot', '');
     $Request->setReturnValue('getParametersFromRequestedUrl', array('controller' => 'test'));
     $this->controller = new AkActionController();
     $this->controller->Request = $Request;
     $this->controller->controller_name = 'test';
     $this->controller->instantiateHelpers();
     $this->active_record_helper =& $this->controller->active_record_helper;
     $this->installAndIncludeModels(array('ProtectedPerson', 'Property'));
     $this->controller->ProtectedPerson =& new ProtectedPerson();
     $this->LuckyLuke =& $this->controller->ProtectedPerson;
     $this->controller->ProtectedPerson->name = "Lucky Luke";
     $this->controller->ProtectedPerson->created_by = "1";
     $this->controller->ProtectedPerson->birthday = Ak::getDate(mktime(8, 42, 36, 3, 27, 1982));
     $this->controller->ProtectedPerson->save();
     $this->controller->ProtectedPerson->created_at = Ak::getDate(mktime(8, 42, 36, 3, 27, 1982));
     $this->controller->ProtectedPerson->updated_at = Ak::getDate(mktime(8, 42, 36, 3, 27, 1982));
     $this->controller->Property =& new Property('description->', '阿尔罕布拉宫', 'details->', '阿尔罕布拉宫 <> & (阿拉伯语: الحمراء‎‎ = Al Ħamrā\'; 即"红色城堡")');
     $this->alhambra =& $this->controller->Property;
     $this->alhambra->save();
 }