adjust unit tests
This commit is contained in:
parent
8afa39682c
commit
e5ba28f934
|
@ -71,12 +71,7 @@ class CommentsNode extends \Test\TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetLastModified() {
|
public function testGetLastModified() {
|
||||||
$dateTime = new \DateTime('2016-01-10 18:48:00');
|
$this->assertSame($this->node->getLastModified(), null);
|
||||||
$this->comment->expects($this->once())
|
|
||||||
->method('getCreationDateTime')
|
|
||||||
->will($this->returnValue($dateTime));
|
|
||||||
|
|
||||||
$this->assertSame($this->node->getLastModified(), $dateTime->getTimestamp());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testUpdateComment() {
|
public function testUpdateComment() {
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace OCA\DAV\Tests\Unit\Comments;
|
||||||
|
|
||||||
use OC\Comments\Comment;
|
use OC\Comments\Comment;
|
||||||
use OCA\DAV\Comments\CommentsPlugin as CommentsPluginImplementation;
|
use OCA\DAV\Comments\CommentsPlugin as CommentsPluginImplementation;
|
||||||
|
use Sabre\DAV\Exception\NotFound;
|
||||||
|
|
||||||
class CommentsPlugin extends \Test\TestCase {
|
class CommentsPlugin extends \Test\TestCase {
|
||||||
/** @var \Sabre\DAV\Server */
|
/** @var \Sabre\DAV\Server */
|
||||||
|
@ -146,6 +147,9 @@ class CommentsPlugin extends \Test\TestCase {
|
||||||
$this->plugin->httpPost($request, $response);
|
$this->plugin->httpPost($request, $response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException \Sabre\DAV\Exception\NotFound
|
||||||
|
*/
|
||||||
public function testCreateCommentInvalidObject() {
|
public function testCreateCommentInvalidObject() {
|
||||||
$commentData = [
|
$commentData = [
|
||||||
'actorType' => 'users',
|
'actorType' => 'users',
|
||||||
|
|
|
@ -74,7 +74,7 @@ class EntityTypeCollection extends \Test\TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \Sabre\DAV\Exception\Forbidden
|
* @expectedException \Sabre\DAV\Exception\NotFound
|
||||||
*/
|
*/
|
||||||
public function testGetChildException() {
|
public function testGetChildException() {
|
||||||
$this->folder->expects($this->once())
|
$this->folder->expects($this->once())
|
||||||
|
|
Loading…
Reference in New Issue