Commit fba7d4e7 authored by Guy Thouret's avatar Guy Thouret

(fix) Test regression in UpdateUserState delegate - #588

1 merge request!285Reward Factors for User Activity
Pipeline #75121292 passed with stages
in 11 minutes and 11 seconds
......@@ -21,10 +21,10 @@ class UpdateUserStateSpec extends ObjectBehavior
public function it_should_update_user_if_activity_state_change(UserState $userState, User $user)
{
$user->getUserState()->shouldBeCalled()->willReturn(UserState::STATE_UNKNOWN);
$userState->getState()->shouldBeCalled()->willReturn(UserState::STATE_NEW);
$userState->getReferenceDateMs()->shouldBeCalled()->willReturn(1563753600000);
$userState->getUserGuid()->shouldBeCalled()->willReturn(1001);
$userState->getStateChange()->shouldBeCalled()->willReturn(1);
$userState->export()->shouldBeCalled()->willReturn([]);
$user->setUserState(UserState::STATE_NEW)->shouldBeCalled()->willReturn($user);
$user->setUserStateUpdatedMs(1563753600000)->shouldBeCalled()->willReturn($user);
......@@ -32,13 +32,4 @@ class UpdateUserStateSpec extends ObjectBehavior
$this->update();
}
public function it_should_not_update_user_if_no_activity_state_change(UserState $userState, User $user)
{
$user->getUserState()->shouldBeCalled()->willReturn(UserState::STATE_NEW);
$userState->getState()->shouldBeCalled()->willReturn(UserState::STATE_NEW);
$user->save()->shouldNotBeCalled();
$this->update();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment