$this->node->delete();
}
-
+
public function testDeleteForbidden() {
$this->expectException(\Sabre\DAV\Exception\Forbidden::class);
$this->assertSame($this->node->getName(), $id);
}
-
+
public function testSetName() {
$this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class);
$this->assertTrue($this->node->updateComment($msg));
}
-
+
public function testUpdateCommentLogException() {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('buh!');
$this->node->updateComment($msg);
}
-
+
public function testUpdateCommentMessageTooLongException() {
$this->expectException(\Sabre\DAV\Exception\BadRequest::class);
$this->expectExceptionMessage('Message exceeds allowed character limit of');
$this->node->updateComment('foo');
}
-
+
public function testUpdateForbiddenByUser() {
$this->expectException(\Sabre\DAV\Exception\Forbidden::class);
$this->node->updateComment($msg);
}
-
+
public function testUpdateForbiddenByType() {
$this->expectException(\Sabre\DAV\Exception\Forbidden::class);
$this->node->updateComment($msg);
}
-
+
public function testUpdateForbiddenByNotLoggedIn() {
$this->expectException(\Sabre\DAV\Exception\Forbidden::class);
$ns . 'latestChildDateTime' => new \DateTime('2016-01-12 18:48:00'),
$ns . 'objectType' => 'files',
$ns . 'objectId' => '1848',
+ $ns . 'referenceId' => 'ref',
$ns . 'isUnread' => null,
];
->method('getObjectId')
->willReturn($expected[$ns . 'objectId']);
+ $this->comment->expects($this->once())
+ ->method('getReferenceId')
+ ->willReturn($expected[$ns . 'referenceId']);
+
$user = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
$properties = $this->node->getProperties(null);
foreach($properties as $name => $value) {
- $this->assertTrue(array_key_exists($name, $expected));
+ $this->assertArrayHasKey($name, $expected);
$this->assertSame($expected[$name], $value);
unset($expected[$name]);
}