diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-27 17:27:18 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-27 17:27:18 +0300 |
commit | 3a7cf40aaa678bea1df143d2982d603b7a334eec (patch) | |
tree | 63c1e3ad7f7f401d14411a4d44c523632906afc9 /apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php | |
parent | 0568b012672d650c6b5a49e72c4028dde5463c60 (diff) |
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php')
-rw-r--r-- | apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php index 5320bd28302..7836191450b 100644 --- a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php @@ -65,7 +65,7 @@ class PrincipalTest extends TestCase { /** @var ProxyMapper | \PHPUnit_Framework_MockObject_MockObject */ private $proxyMapper; - public function setUp(): void { + protected function setUp(): void { $this->userManager = $this->createMock(IUserManager::class); $this->groupManager = $this->createMock(IGroupManager::class); $this->shareManager = $this->createMock(IManager::class); @@ -209,11 +209,11 @@ class PrincipalTest extends TestCase { $this->assertSame([], $response); } - /** - * @expectedException \Sabre\DAV\Exception - * @expectedExceptionMessage Principal not found - */ + public function testGetGroupMemberSetEmpty() { + $this->expectException(\Sabre\DAV\Exception::class); + $this->expectExceptionMessage('Principal not found'); + $this->userManager ->expects($this->once()) ->method('get') @@ -334,11 +334,11 @@ class PrincipalTest extends TestCase { $this->assertSame($expectedResponse, $response); } - /** - * @expectedException \Sabre\DAV\Exception - * @expectedExceptionMessage Principal not found - */ + public function testGetGroupMembershipEmpty() { + $this->expectException(\Sabre\DAV\Exception::class); + $this->expectExceptionMessage('Principal not found'); + $this->userManager ->expects($this->once()) ->method('get') @@ -348,11 +348,11 @@ class PrincipalTest extends TestCase { $this->connector->getGroupMembership('principals/users/foo'); } - /** - * @expectedException \Sabre\DAV\Exception - * @expectedExceptionMessage Setting members of the group is not supported yet - */ + public function testSetGroupMembership() { + $this->expectException(\Sabre\DAV\Exception::class); + $this->expectExceptionMessage('Setting members of the group is not supported yet'); + $this->connector->setGroupMemberSet('principals/users/foo', ['foo']); } |