diff options
Diffstat (limited to 'tests/lib/User/SessionTest.php')
-rw-r--r-- | tests/lib/User/SessionTest.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/lib/User/SessionTest.php b/tests/lib/User/SessionTest.php index a9d466e5408..3567aa9cf62 100644 --- a/tests/lib/User/SessionTest.php +++ b/tests/lib/User/SessionTest.php @@ -271,10 +271,10 @@ class SessionTest extends \Test\TestCase { $this->assertEquals($user, $userSession->getUser()); } - /** - * @expectedException \OC\User\LoginException - */ + public function testLoginValidPasswordDisabled() { + $this->expectException(\OC\User\LoginException::class); + $session = $this->getMockBuilder(Memory::class)->setConstructorArgs([''])->getMock(); $session->expects($this->never()) ->method('set'); @@ -404,10 +404,10 @@ class SessionTest extends \Test\TestCase { $userSession->login('foo', 'bar'); } - /** - * @expectedException \OC\Authentication\Exceptions\PasswordLoginForbiddenException - */ + public function testLogClientInNoTokenPasswordWith2fa() { + $this->expectException(\OC\Authentication\Exceptions\PasswordLoginForbiddenException::class); + $manager = $this->createMock(Manager::class); $session = $this->createMock(ISession::class); $request = $this->createMock(IRequest::class); @@ -508,10 +508,10 @@ class SessionTest extends \Test\TestCase { $this->assertTrue($userSession->logClientIn('john', 'I-AM-AN-APP-PASSWORD', $request, $this->throttler)); } - /** - * @expectedException \OC\Authentication\Exceptions\PasswordLoginForbiddenException - */ + public function testLogClientInNoTokenPasswordNo2fa() { + $this->expectException(\OC\Authentication\Exceptions\PasswordLoginForbiddenException::class); + $manager = $this->createMock(Manager::class); $session = $this->createMock(ISession::class); $request = $this->createMock(IRequest::class); @@ -973,10 +973,10 @@ class SessionTest extends \Test\TestCase { $this->assertFalse($userSession->createSessionToken($request, $uid, $loginName, $password)); } - /** - * @expectedException \OC\User\LoginException - */ + public function testTryTokenLoginWithDisabledUser() { + $this->expectException(\OC\User\LoginException::class); + $manager = $this->getMockBuilder('\OC\User\Manager') ->disableOriginalConstructor() ->getMock(); |