Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Share20/ShareTest.php')
-rw-r--r--tests/lib/Share20/ShareTest.php34
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/lib/Share20/ShareTest.php b/tests/lib/Share20/ShareTest.php
index 45975d5996c..f7ea479350d 100644
--- a/tests/lib/Share20/ShareTest.php
+++ b/tests/lib/Share20/ShareTest.php
@@ -36,17 +36,17 @@ class ShareTest extends \Test\TestCase {
/** @var \OCP\Share\IShare */
protected $share;
- public function setUp(): void {
+ protected function setUp(): void {
$this->rootFolder = $this->createMock(IRootFolder::class);
$this->userManager = $this->createMock(IUserManager::class);
$this->share = new \OC\Share20\Share($this->rootFolder, $this->userManager);
}
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage String expected.
- */
+
public function testSetIdInvalid() {
+ $this->expectException(\InvalidArgumentException::class);
+ $this->expectExceptionMessage('String expected.');
+
$this->share->setId(1.2);
}
@@ -61,20 +61,20 @@ class ShareTest extends \Test\TestCase {
$this->assertEquals('foo', $this->share->getId());
}
- /**
- * @expectedException \OCP\Share\Exceptions\IllegalIDChangeException
- * @expectedExceptionMessage Not allowed to assign a new internal id to a share
- */
+
public function testSetIdOnce() {
+ $this->expectException(\OCP\Share\Exceptions\IllegalIDChangeException::class);
+ $this->expectExceptionMessage('Not allowed to assign a new internal id to a share');
+
$this->share->setId('foo');
$this->share->setId('bar');
}
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage String expected.
- */
+
public function testSetProviderIdInt() {
+ $this->expectException(\InvalidArgumentException::class);
+ $this->expectExceptionMessage('String expected.');
+
$this->share->setProviderId(42);
}
@@ -85,11 +85,11 @@ class ShareTest extends \Test\TestCase {
$this->assertEquals('foo:bar', $this->share->getFullId());
}
- /**
- * @expectedException \OCP\Share\Exceptions\IllegalIDChangeException
- * @expectedExceptionMessage Not allowed to assign a new provider id to a share
- */
+
public function testSetProviderIdOnce() {
+ $this->expectException(\OCP\Share\Exceptions\IllegalIDChangeException::class);
+ $this->expectExceptionMessage('Not allowed to assign a new provider id to a share');
+
$this->share->setProviderId('foo');
$this->share->setProviderId('bar');
}