Exemple #1
0
 function Test_of_addConditions()
 {
     $AkTestUser = new AkTestUser();
     $sql = 'SELECT * FROM ak_test_users';
     $copy = $sql;
     $conditions = "last_name = 'Ferrer' AND country = 25";
     $AkTestUser->addConditions($sql, $conditions);
     $this->assertEqual($sql, $copy . ' WHERE ' . $conditions);
     $AkTestMember = new AkTestMember();
     $sql = 'SELECT * FROM ak_test_members, ak_test_users';
     $copy = $sql;
     $conditions = "ak_test_users.last_name = 'Ferrer' AND ak_test_users.country = 25";
     $AkTestMember->setInheritanceColumn('role');
     $AkTestMember->addConditions($sql, $conditions);
     $this->assertEqual($sql, $copy . ' WHERE ' . $conditions . " AND ( ak_test_members.role = 'Ak test member' ) ");
 }