From 3a7cf40aaa678bea1df143d2982d603b7a334eec Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 27 Nov 2019 15:27:18 +0100 Subject: Mode to modern phpunit Signed-off-by: Roeland Jago Douma --- apps/federatedfilesharing/tests/AddressHandlerTest.php | 5 +++-- .../tests/Controller/MountPublicLinkControllerTest.php | 2 +- apps/federatedfilesharing/tests/FederatedShareProviderTest.php | 4 ++-- apps/federatedfilesharing/tests/NotificationsTest.php | 2 +- apps/federatedfilesharing/tests/Settings/AdminTest.php | 2 +- apps/federatedfilesharing/tests/TokenHandlerTest.php | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) (limited to 'apps/federatedfilesharing/tests') diff --git a/apps/federatedfilesharing/tests/AddressHandlerTest.php b/apps/federatedfilesharing/tests/AddressHandlerTest.php index efea34dbab2..e6ef4ddd7f3 100644 --- a/apps/federatedfilesharing/tests/AddressHandlerTest.php +++ b/apps/federatedfilesharing/tests/AddressHandlerTest.php @@ -46,7 +46,7 @@ class AddressHandlerTest extends \Test\TestCase { /** @var CloudIdManager */ private $cloudIdManager; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->urlGenerator = $this->getMockBuilder(IURLGenerator::class) @@ -125,9 +125,10 @@ class AddressHandlerTest extends \Test\TestCase { * @dataProvider dataTestSplitUserRemoteError * * @param string $id - * @expectedException \OC\HintException */ public function testSplitUserRemoteError($id) { + $this->expectException(\OC\HintException::class); + $this->addressHandler->splitUserRemote($id); } diff --git a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php index 88f486f3c69..405d83cc91c 100644 --- a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php +++ b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php @@ -84,7 +84,7 @@ class MountPublicLinkControllerTest extends \Test\TestCase { /** @var ICloudIdManager */ private $cloudIdManager; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->request = $this->getMockBuilder(IRequest::class)->disableOriginalConstructor()->getMock(); diff --git a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php index 31d13df8f31..1e0863fe1ce 100644 --- a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php +++ b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php @@ -85,7 +85,7 @@ class FederatedShareProviderTest extends \Test\TestCase { /** @var \PHPUnit_Framework_MockObject_MockObject|ICloudFederationProviderManager */ private $cloudFederationProviderManager; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -131,7 +131,7 @@ class FederatedShareProviderTest extends \Test\TestCase { $this->shareManager = \OC::$server->getShareManager(); } - public function tearDown(): void { + protected function tearDown(): void { $this->connection->getQueryBuilder()->delete('share')->execute(); parent::tearDown(); diff --git a/apps/federatedfilesharing/tests/NotificationsTest.php b/apps/federatedfilesharing/tests/NotificationsTest.php index 769184f1628..abc8e9495bc 100644 --- a/apps/federatedfilesharing/tests/NotificationsTest.php +++ b/apps/federatedfilesharing/tests/NotificationsTest.php @@ -53,7 +53,7 @@ class NotificationsTest extends \Test\TestCase { /** @var ICloudFederationFactory|\PHPUnit_Framework_MockObject_MockObject */ private $cloudFederationFactory; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->jobList = $this->getMockBuilder('OCP\BackgroundJob\IJobList')->getMock(); diff --git a/apps/federatedfilesharing/tests/Settings/AdminTest.php b/apps/federatedfilesharing/tests/Settings/AdminTest.php index bca8ad73426..7eccf846f4b 100644 --- a/apps/federatedfilesharing/tests/Settings/AdminTest.php +++ b/apps/federatedfilesharing/tests/Settings/AdminTest.php @@ -38,7 +38,7 @@ class AdminTest extends TestCase { /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */ private $gsConfig; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->federatedShareProvider = $this->createMock(FederatedShareProvider::class); $this->gsConfig = $this->createMock(IConfig::class); diff --git a/apps/federatedfilesharing/tests/TokenHandlerTest.php b/apps/federatedfilesharing/tests/TokenHandlerTest.php index bd3c0f92911..56039b1f801 100644 --- a/apps/federatedfilesharing/tests/TokenHandlerTest.php +++ b/apps/federatedfilesharing/tests/TokenHandlerTest.php @@ -39,7 +39,7 @@ class TokenHandlerTest extends \Test\TestCase { /** @var int */ private $expectedTokenLength = 15; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->secureRandom = $this->getMockBuilder(ISecureRandom::class)->getMock(); -- cgit v1.2.3