Commit 9aa1d79c authored by Jacob Priddy's avatar Jacob Priddy 👌
Browse files

Add a few more update user tests

parent 5114a535
......@@ -113,4 +113,37 @@ class UseCaseTest extends TestCase {
$this->assertTrue($this->response->hasError());
$this->assertEquals('Unable to update user.', $this->response->getError());
}
/**
* @test
* @throws EntityNotFoundException
*/
public function it_doesnt_need_doorcode_or_password(): void {
$user = new User(69, '', '', '', null, '', 'pass', 'door', null, null, null);
$updatedUser = new User(0, '', '', '', null, '', '', '', null, null, null);
$this->usersRepository->create($user);
$this->handleTest('69', $this->createUserAttributes($updatedUser, null, null));
$this->assertEquals('pass', $this->response->getUser()->getPassword());
$this->assertEquals('door', $this->response->getUser()->getDoorcode());
}
/**
* @test
* @throws EntityNotFoundException
*/
public function it_will_overwirte_doorcode_and_password(): void {
$user = new User(69, '', '', '', null, '', '', '', null, null, null);
$updatedUser = new User(0, '', '', '', null, '', '', '', null, null, null);
$this->usersRepository->create($user);
$this->handleTest('69', $this->createUserAttributes($updatedUser, 'pass', 'door'));
$this->assertEquals('pass', $this->response->getUser()->getPassword());
$this->assertEquals('door', $this->response->getUser()->getDoorcode());
}
}
Supports Markdown
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