summaryrefslogtreecommitdiffstats
path: root/apps/sharebymail
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-11-28 08:36:10 +0100
committerGitHub <noreply@github.com>2019-11-28 08:36:10 +0100
commit669302e570024c83140ff5c4f4b1489c5a1c66ed (patch)
tree010182798f5c83193554031753e063a8a0b35ca1 /apps/sharebymail
parent125be68311a319f2b839e5aa4ea29cd642cd1e00 (diff)
parente3e782b63df4f1d65c86cb3b204b4bdecf93a6cd (diff)
downloadnextcloud-server-669302e570024c83140ff5c4f4b1489c5a1c66ed.tar.gz
nextcloud-server-669302e570024c83140ff5c4f4b1489c5a1c66ed.zip
Merge pull request #18064 from nextcloud/feature/php74
Add php7.4 support
Diffstat (limited to 'apps/sharebymail')
-rw-r--r--apps/sharebymail/tests/CapabilitiesTest.php2
-rw-r--r--apps/sharebymail/tests/SettingsTest.php2
-rw-r--r--apps/sharebymail/tests/ShareByMailProviderTest.php38
3 files changed, 21 insertions, 21 deletions
diff --git a/apps/sharebymail/tests/CapabilitiesTest.php b/apps/sharebymail/tests/CapabilitiesTest.php
index b1545994199..1e19ffd2eaf 100644
--- a/apps/sharebymail/tests/CapabilitiesTest.php
+++ b/apps/sharebymail/tests/CapabilitiesTest.php
@@ -26,7 +26,7 @@ class CapabilitiesTest extends TestCase {
/** @var Capabilities */
private $capabilities;
- public function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->capabilities = new Capabilities();
diff --git a/apps/sharebymail/tests/SettingsTest.php b/apps/sharebymail/tests/SettingsTest.php
index b7150e6c6dc..a05d4f5926b 100644
--- a/apps/sharebymail/tests/SettingsTest.php
+++ b/apps/sharebymail/tests/SettingsTest.php
@@ -34,7 +34,7 @@ class SettingsTest extends TestCase {
/** @var SettingsManager | \PHPUnit_Framework_MockObject_MockObject */
private $settingsManager;
- public function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->settingsManager = $this->getMockBuilder(SettingsManager::class)
diff --git a/apps/sharebymail/tests/ShareByMailProviderTest.php b/apps/sharebymail/tests/ShareByMailProviderTest.php
index 744c2d6f3ee..4efd528b2d1 100644
--- a/apps/sharebymail/tests/ShareByMailProviderTest.php
+++ b/apps/sharebymail/tests/ShareByMailProviderTest.php
@@ -97,7 +97,7 @@ class ShareByMailProviderTest extends TestCase {
/** @var CapabilitiesManager | \PHPUnit_Framework_MockObject_MockObject */
private $capabilitiesManager;
- public function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->shareManager = \OC::$server->getShareManager();
@@ -174,10 +174,10 @@ class ShareByMailProviderTest extends TestCase {
}
- public function tearDown() {
+ protected function tearDown(): void {
$this->connection->getQueryBuilder()->delete('share')->execute();
- return parent::tearDown();
+ parent::tearDown();
}
public function testCreate() {
@@ -305,10 +305,10 @@ class ShareByMailProviderTest extends TestCase {
);
}
- /**
- * @expectedException \Exception
- */
+
public function testCreateFailed() {
+ $this->expectException(\Exception::class);
+
$this->share->expects($this->once())->method('getSharedWith')->willReturn('user1');
$node = $this->getMockBuilder('OCP\Files\Node')->getMock();
$node->expects($this->any())->method('getName')->willReturn('fileName');
@@ -348,10 +348,10 @@ class ShareByMailProviderTest extends TestCase {
}
- /**
- * @expectedException \OC\HintException
- */
+
public function testCreateMailShareFailed() {
+ $this->expectException(\OC\HintException::class);
+
$this->share->expects($this->any())->method('getToken')->willReturn('token');
$this->share->expects($this->once())->method('setToken')->with('token');
$node = $this->getMockBuilder('OCP\Files\Node')->getMock();
@@ -503,7 +503,7 @@ class ShareByMailProviderTest extends TestCase {
* @param string newSendPasswordByTalk
* @param bool sendMail
*/
- public function testUpdateSendPassword($plainTextPassword, string $originalPassword, string $newPassword, string $originalSendPasswordByTalk, string $newSendPasswordByTalk, bool $sendMail) {
+ public function testUpdateSendPassword($plainTextPassword, string $originalPassword, string $newPassword, $originalSendPasswordByTalk, $newSendPasswordByTalk, bool $sendMail) {
$node = $this->getMockBuilder(File::class)->getMock();
$node->expects($this->any())->method('getName')->willReturn('filename');
@@ -572,10 +572,10 @@ class ShareByMailProviderTest extends TestCase {
$this->assertInstanceOf('OCP\Share\IShare', $result);
}
- /**
- * @expectedException \OCP\Share\Exceptions\ShareNotFound
- */
+
public function testGetShareByIdFailed() {
+ $this->expectException(\OCP\Share\Exceptions\ShareNotFound::class);
+
$instance = $this->getInstance(['createShareObject']);
$itemSource = 11;
@@ -657,10 +657,10 @@ class ShareByMailProviderTest extends TestCase {
$this->assertInstanceOf('OCP\Share\IShare', $result);
}
- /**
- * @expectedException \OCP\Share\Exceptions\ShareNotFound
- */
+
public function testGetShareByTokenFailed() {
+ $this->expectException(\OCP\Share\Exceptions\ShareNotFound::class);
+
$itemSource = 11;
$itemType = 'file';
@@ -774,10 +774,10 @@ class ShareByMailProviderTest extends TestCase {
$this->assertSame($token, $result['token']);
}
- /**
- * @expectedException \OCP\Share\Exceptions\ShareNotFound
- */
+
public function testGetRawShareFailed() {
+ $this->expectException(\OCP\Share\Exceptions\ShareNotFound::class);
+
$itemSource = 11;
$itemType = 'file';
$shareWith = 'user@server.com';