/** * 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()); }
/** * 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; }
public function clearScore(User $user) { // Empty score sheet $this->scores[$user->getUserId()] = array('seasonPoints' => 0, 'shots' => 0); return $this; }