Ejemplo n.º 1
0
 public function add_user_to_group_test()
 {
     $user = test::random_user();
     $group = test::random_group();
     $group->add($user);
     $group->save();
     $this->assert_true($user->has($group));
 }
Ejemplo n.º 2
0
 public function login_failed_test()
 {
     $user = test::random_user("password");
     try {
         $_POST["user"] = $user->name;
         $_POST["password"] = "******";
         test::call_and_capture(array(new Rest_Controller(), "index"));
     } catch (Rest_Exception $e) {
         $this->assert_equal(403, $e->getCode());
         return;
     }
     $this->assert_true(false, "Shouldn't get here");
 }