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 /tests/lib/User/ManagerTest.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 'tests/lib/User/ManagerTest.php')
-rw-r--r-- | tests/lib/User/ManagerTest.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/lib/User/ManagerTest.php b/tests/lib/User/ManagerTest.php index 4d70e30273a..58a6b550658 100644 --- a/tests/lib/User/ManagerTest.php +++ b/tests/lib/User/ManagerTest.php @@ -30,7 +30,7 @@ class ManagerTest extends TestCase { /** @var EventDispatcherInterface */ private $dispatcher; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); @@ -367,10 +367,10 @@ class ManagerTest extends TestCase { $this->assertEquals('foo', $user->getUID()); } - /** - * @expectedException \Exception - */ + public function testCreateUserSingleBackendExists() { + $this->expectException(\Exception::class); + /** * @var \Test\Util\User\Dummy | \PHPUnit_Framework_MockObject_MockObject $backend */ @@ -420,11 +420,11 @@ class ManagerTest extends TestCase { $this->assertFalse($manager->createUser('foo', 'bar')); } - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Could not create user - */ + public function testCreateUserFromBackendWithBackendError() { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Could not create user'); + /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject $config */ $config = $this->createMock(IConfig::class); /** @var \Test\Util\User\Dummy|\PHPUnit_Framework_MockObject_MockObject $backend */ @@ -439,10 +439,10 @@ class ManagerTest extends TestCase { $manager->createUserFromBackend('MyUid', 'MyPassword', $backend); } - /** - * @expectedException \Exception - */ + public function testCreateUserTwoBackendExists() { + $this->expectException(\Exception::class); + /** * @var \Test\Util\User\Dummy | \PHPUnit_Framework_MockObject_MockObject $backend1 */ |