aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/Upload
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 15:27:18 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 15:27:18 +0100
commit3a7cf40aaa678bea1df143d2982d603b7a334eec (patch)
tree63c1e3ad7f7f401d14411a4d44c523632906afc9 /apps/dav/tests/unit/Upload
parent0568b012672d650c6b5a49e72c4028dde5463c60 (diff)
downloadnextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.tar.gz
nextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.zip
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/tests/unit/Upload')
-rw-r--r--apps/dav/tests/unit/Upload/ChunkingPluginTest.php10
-rw-r--r--apps/dav/tests/unit/Upload/FutureFileTest.php12
2 files changed, 11 insertions, 11 deletions
diff --git a/apps/dav/tests/unit/Upload/ChunkingPluginTest.php b/apps/dav/tests/unit/Upload/ChunkingPluginTest.php
index bc2b434bcf7..3135ced2612 100644
--- a/apps/dav/tests/unit/Upload/ChunkingPluginTest.php
+++ b/apps/dav/tests/unit/Upload/ChunkingPluginTest.php
@@ -51,7 +51,7 @@ class ChunkingPluginTest extends TestCase {
/** @var ResponseInterface | \PHPUnit_Framework_MockObject_MockObject */
private $response;
- public function setUp(): void {
+ protected function setUp(): void {
parent::setUp();
$this->server = $this->getMockBuilder('\Sabre\DAV\Server')
@@ -141,11 +141,11 @@ class ChunkingPluginTest extends TestCase {
$this->assertFalse($this->plugin->beforeMove('source', 'target'));
}
- /**
- * @expectedException \Sabre\DAV\Exception\BadRequest
- * @expectedExceptionMessage Chunks on server do not sum up to 4 but to 3 bytes
- */
+
public function testBeforeMoveSizeIsWrong() {
+ $this->expectException(\Sabre\DAV\Exception\BadRequest::class);
+ $this->expectExceptionMessage('Chunks on server do not sum up to 4 but to 3 bytes');
+
$sourceNode = $this->createMock(FutureFile::class);
$sourceNode->expects($this->once())
->method('getSize')
diff --git a/apps/dav/tests/unit/Upload/FutureFileTest.php b/apps/dav/tests/unit/Upload/FutureFileTest.php
index 94be4ea66dd..cfe3491d13f 100644
--- a/apps/dav/tests/unit/Upload/FutureFileTest.php
+++ b/apps/dav/tests/unit/Upload/FutureFileTest.php
@@ -73,18 +73,18 @@ class FutureFileTest extends \Test\TestCase {
$f->delete();
}
- /**
- * @expectedException Sabre\DAV\Exception\Forbidden
- */
+
public function testPut() {
+ $this->expectException(\Sabre\DAV\Exception\Forbidden::class);
+
$f = $this->mockFutureFile();
$f->put('');
}
- /**
- * @expectedException Sabre\DAV\Exception\Forbidden
- */
+
public function testSetName() {
+ $this->expectException(\Sabre\DAV\Exception\Forbidden::class);
+
$f = $this->mockFutureFile();
$f->setName('');
}