Example #1
0
 public function Test_of_updateAll_with_binds()
 {
     $Users = new AkTestUser();
     $modified_entries = $Users->updateAll("first_name = 'new_test_name', country = '50'", array("first_name = ?", 'test_name'));
     $this->assertEqual($modified_entries, 3);
     $FoundUsers = $Users->find(5, 6, 7);
     foreach ($FoundUsers as $FoundUser) {
         $this->assertEqual($FoundUser->first_name, 'new_test_name');
         $this->assertEqual($FoundUser->country, 50);
     }
 }
Example #2
0
 function Test_of_countBySql()
 {
     $AkTestUser = new AkTestUser();
     $this->assertEqual($AkTestUser->countBySql("SELECT COUNT(*) FROM ak_test_users"), count($AkTestUser->find()));
     $this->assertEqual($AkTestUser->countBySql("SELECT COUNT(*) FROM ak_test_users WHERE first_name = 'Tim'"), count($AkTestUser->findAll("first_name = 'Tim'")));
 }
Example #3
0
 function Test_of_updateAll()
 {
     $Users = new AkTestUser();
     $modified_entries = $Users->updateAll("first_name = 'test_name', country = '50'", "first_name = 'NEW TEST NAME'");
     $this->assertEqual($modified_entries, 3);
     $FoundUsers = $Users->find(5, 6, 7);
     foreach ($FoundUsers as $FoundUser) {
         $this->assertEqual($FoundUser->first_name, 'test_name');
         $this->assertEqual($FoundUser->country, 50);
     }
 }