/** * @param UserLoginResultType $result * @param string $email * @param string $ip4 * @param User|null $user * @param UserToken|null $userToken */ public function __construct(UserLoginResultType $result, $email, $ip4, User $user = null, UserToken $userToken = null) { $this->setId(); $this->setCreated(); $this->result = $result; $this->email = (string) $email; $this->ip4 = (int) ip2long($ip4); if ($user !== null) { $user->addUserLogin($this); $this->user = $user; } if ($userToken !== null) { $userToken->addUserLogin($this); $this->userToken = $userToken; } }
public function testCreate() { $userLogin = $this->dummyData->getUserLogin(); $this->userToken->addUserLogin($userLogin); $this->assertEntityValid($this->userToken); }