Beispiel #1
0
 /**
  * When a data set is reloaded to the model, the dirty state should be
  * reset
  * 
  * @covers ::__set
  * @covers ::setData
  * @covers ::isDirty
  * 
  * @test
  */
 public function resetChangedUserModelData()
 {
     // Get user instance
     $user = new User();
     // Change user data
     $user->userId = 1;
     // Assert user model has been changed
     $this->assertTrue($user->isDirty());
     // Reload data
     $user->setData(array('userId' => 1));
     // Assert user model has been changed
     $this->assertFalse($user->isDirty());
 }
Beispiel #2
0
 /**
  * Clear the users' score sheet
  * 
  * @param User $user
  * @return Game
  */
 protected function clearScore(User $user)
 {
     // Empty score sheet
     $this->scores[$user->getUserId()] = array('score' => 0, 'shots' => 0);
     return $this;
 }
Beispiel #3
0
 public function clearScore(User $user)
 {
     // Empty score sheet
     $this->scores[$user->getUserId()] = array('seasonPoints' => 0, 'shots' => 0);
     return $this;
 }