Esempio n. 1
0
 /**
  * @test
  */
 public function shouldCreateUser()
 {
     //when
     $this->post('/users', array('user' => array('login' => 'login')));
     //then
     $this->assertNotNull(User::where(array('login' => 'login'))->fetch());
 }
Esempio n. 2
0
 /**
  * @test
  */
 public function shouldPersistUser()
 {
     //given
     $user = new User(array('login' => 'user1', 'password' => 'abc'));
     //when
     $user->insert();
     //then
     $this->assertEquals($user, User::where(array('login' => 'user1'))->fetch());
 }
Esempio n. 3
0
 /**
  * @return User[]
  */
 public function possibleUsers()
 {
     $currentGame = self::currentGame();
     return User::where('not exists (select true from game_users where game_id = ? AND user_id = users.id)', $currentGame->id)->fetchAll();
 }