diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-27 15:27:18 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-27 15:27:18 +0100 |
commit | 3a7cf40aaa678bea1df143d2982d603b7a334eec (patch) | |
tree | 63c1e3ad7f7f401d14411a4d44c523632906afc9 /apps/user_ldap/tests/User_LDAPTest.php | |
parent | 0568b012672d650c6b5a49e72c4028dde5463c60 (diff) | |
download | nextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.tar.gz nextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.zip |
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/user_ldap/tests/User_LDAPTest.php')
-rw-r--r-- | apps/user_ldap/tests/User_LDAPTest.php | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php index e8076a051a1..b4766300df5 100644 --- a/apps/user_ldap/tests/User_LDAPTest.php +++ b/apps/user_ldap/tests/User_LDAPTest.php @@ -787,10 +787,10 @@ class User_LDAPTest extends TestCase { $this->assertEquals($dataDir.'/susannah/', $result); } - /** - * @expectedException \Exception - */ + public function testGetHomeNoPath() { + $this->expectException(\Exception::class); + $backend = new UserLDAP($this->access, $this->config, $this->notificationManager, $this->session, $this->pluginManager); $this->prepareMockForUserExists(); @@ -836,10 +836,10 @@ class User_LDAPTest extends TestCase { $this->assertFalse($result); } - /** - * @expectedException \OC\User\NoUserException - */ + public function testGetHomeDeletedUser() { + $this->expectException(\OC\User\NoUserException::class); + $uid = 'newyorker'; $backend = new UserLDAP($this->access, $this->config, $this->notificationManager, $this->session, $this->pluginManager); @@ -1280,11 +1280,11 @@ class User_LDAPTest extends TestCase { })); } - /** - * @expectedException \OC\HintException - * @expectedExceptionMessage Password fails quality checking policy - */ + public function testSetPasswordInvalid() { + $this->expectException(\OC\HintException::class); + $this->expectExceptionMessage('Password fails quality checking policy'); + $this->prepareAccessForSetPassword($this->access); $this->userManager->expects($this->atLeastOnce()) ->method('get') @@ -1324,11 +1324,11 @@ class User_LDAPTest extends TestCase { $this->assertFalse(\OC_User::setPassword('roland', 'dt12234$')); } - /** - * @expectedException \Exception - * @expectedExceptionMessage LDAP setPassword: Could not get user object for uid NotExistingUser. Maybe the LDAP entry has no set display name attribute? - */ + public function testSetPasswordWithInvalidUser() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('LDAP setPassword: Could not get user object for uid NotExistingUser. Maybe the LDAP entry has no set display name attribute?'); + $this->userManager ->expects($this->once()) ->method('get') @@ -1425,10 +1425,10 @@ class User_LDAPTest extends TestCase { $this->assertEquals($newDisplayName, $this->backend->setDisplayName('uid', $newDisplayName)); } - /** - * @expectedException \OC\HintException - */ + public function testSetDisplayNameErrorWithPlugin() { + $this->expectException(\OC\HintException::class); + $newDisplayName = 'J. Baker'; $this->pluginManager->expects($this->once()) ->method('implementsActions') |