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/UserLDAPPluginTest.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/UserLDAPPluginTest.php')
-rw-r--r-- | apps/user_ldap/tests/UserLDAPPluginTest.php | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/apps/user_ldap/tests/UserLDAPPluginTest.php b/apps/user_ldap/tests/UserLDAPPluginTest.php index 1d7d2ee7c75..fac6156450a 100644 --- a/apps/user_ldap/tests/UserLDAPPluginTest.php +++ b/apps/user_ldap/tests/UserLDAPPluginTest.php @@ -85,11 +85,11 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->createUser('user', 'password'); } - /** - * @expectedException \Exception - * @expectedExceptionMessage No plugin implements createUser in this LDAP Backend. - */ + public function testCreateUserNotRegistered() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('No plugin implements createUser in this LDAP Backend.'); + $pluginManager = $this->getUserPluginManager(); $pluginManager->createUser('foo','bar'); } @@ -116,11 +116,11 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->setPassword('user', 'password'); } - /** - * @expectedException \Exception - * @expectedExceptionMessage No plugin implements setPassword in this LDAP Backend. - */ + public function testSetPasswordNotRegistered() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('No plugin implements setPassword in this LDAP Backend.'); + $pluginManager = $this->getUserPluginManager(); $pluginManager->setPassword('foo','bar'); } @@ -146,11 +146,11 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->getHome('uid'); } - /** - * @expectedException \Exception - * @expectedExceptionMessage No plugin implements getHome in this LDAP Backend. - */ + public function testGetHomeNotRegistered() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('No plugin implements getHome in this LDAP Backend.'); + $pluginManager = $this->getUserPluginManager(); $pluginManager->getHome('foo'); } @@ -176,11 +176,11 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->getDisplayName('uid'); } - /** - * @expectedException \Exception - * @expectedExceptionMessage No plugin implements getDisplayName in this LDAP Backend. - */ + public function testGetDisplayNameNotRegistered() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('No plugin implements getDisplayName in this LDAP Backend.'); + $pluginManager = $this->getUserPluginManager(); $pluginManager->getDisplayName('foo'); } @@ -207,11 +207,11 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->setDisplayName('user', 'password'); } - /** - * @expectedException \Exception - * @expectedExceptionMessage No plugin implements setDisplayName in this LDAP Backend. - */ + public function testSetDisplayNameNotRegistered() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('No plugin implements setDisplayName in this LDAP Backend.'); + $pluginManager = $this->getUserPluginManager(); $pluginManager->setDisplayName('foo', 'bar'); } @@ -237,11 +237,11 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->canChangeAvatar('uid'); } - /** - * @expectedException \Exception - * @expectedExceptionMessage No plugin implements canChangeAvatar in this LDAP Backend. - */ + public function testCanChangeAvatarNotRegistered() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('No plugin implements canChangeAvatar in this LDAP Backend.'); + $pluginManager = $this->getUserPluginManager(); $pluginManager->canChangeAvatar('foo'); } @@ -264,11 +264,11 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->countUsers(); } - /** - * @expectedException \Exception - * @expectedExceptionMessage No plugin implements countUsers in this LDAP Backend. - */ + public function testCountUsersNotRegistered() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('No plugin implements countUsers in this LDAP Backend.'); + $pluginManager = $this->getUserPluginManager(); $pluginManager->countUsers(); } @@ -300,11 +300,11 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->deleteUser('uid'); } - /** - * @expectedException \Exception - * @expectedExceptionMessage No plugin implements deleteUser in this LDAP Backend. - */ + public function testDeleteUserNotRegistered() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('No plugin implements deleteUser in this LDAP Backend.'); + $pluginManager = $this->getUserPluginManager(); $pluginManager->deleteUser('foo'); } |