diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-12-04 17:30:22 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-12-04 17:30:50 +0100 |
commit | 316b907a13fcca9781f09b0f1a2a2d7324e42770 (patch) | |
tree | f0bc680aba91503c741bd4e0cf2420124c4ab6c9 /apps/dav/tests/unit | |
parent | fe95fd5bec5e4b52112ab68cff0d942bb8ffb226 (diff) | |
download | nextcloud-server-316b907a13fcca9781f09b0f1a2a2d7324e42770.tar.gz nextcloud-server-316b907a13fcca9781f09b0f1a2a2d7324e42770.zip |
Fixed system tags DAV and API and docs
Diffstat (limited to 'apps/dav/tests/unit')
-rw-r--r-- | apps/dav/tests/unit/systemtag/systemtagsbyidcollection.php | 24 | ||||
-rw-r--r-- | apps/dav/tests/unit/systemtag/systemtagsobjectmappingcollection.php | 26 |
2 files changed, 25 insertions, 25 deletions
diff --git a/apps/dav/tests/unit/systemtag/systemtagsbyidcollection.php b/apps/dav/tests/unit/systemtag/systemtagsbyidcollection.php index fdaaf2cd009..104ce366034 100644 --- a/apps/dav/tests/unit/systemtag/systemtagsbyidcollection.php +++ b/apps/dav/tests/unit/systemtag/systemtagsbyidcollection.php @@ -51,8 +51,8 @@ class SystemTagsByIdCollection extends \Test\TestCase { $tag = new SystemTag(123, 'Test', true, false); $this->tagManager->expects($this->once()) - ->method('getTagsById') - ->with('123') + ->method('getTagsByIds') + ->with(['123']) ->will($this->returnValue([$tag])); $childNode = $this->node->getChild('123'); @@ -67,8 +67,8 @@ class SystemTagsByIdCollection extends \Test\TestCase { */ public function testGetChildInvalidName() { $this->tagManager->expects($this->once()) - ->method('getTagsById') - ->with('invalid') + ->method('getTagsByIds') + ->with(['invalid']) ->will($this->throwException(new \InvalidArgumentException())); $this->node->getChild('invalid'); @@ -79,8 +79,8 @@ class SystemTagsByIdCollection extends \Test\TestCase { */ public function testGetChildNotFound() { $this->tagManager->expects($this->once()) - ->method('getTagsById') - ->with('444') + ->method('getTagsByIds') + ->with(['444']) ->will($this->throwException(new TagNotFoundException())); $this->node->getChild('444'); @@ -117,8 +117,8 @@ class SystemTagsByIdCollection extends \Test\TestCase { $tag = new SystemTag(123, 'One', true, false); $this->tagManager->expects($this->once()) - ->method('getTagsById') - ->with('123') + ->method('getTagsByIds') + ->with(['123']) ->will($this->returnValue([$tag])); $this->assertTrue($this->node->childExists('123')); @@ -126,8 +126,8 @@ class SystemTagsByIdCollection extends \Test\TestCase { public function testChildExistsNotFound() { $this->tagManager->expects($this->once()) - ->method('getTagsById') - ->with('123') + ->method('getTagsByIds') + ->with(['123']) ->will($this->throwException(new TagNotFoundException())); $this->assertFalse($this->node->childExists('123')); @@ -138,8 +138,8 @@ class SystemTagsByIdCollection extends \Test\TestCase { */ public function testChildExistsBadRequest() { $this->tagManager->expects($this->once()) - ->method('getTagsById') - ->with('invalid') + ->method('getTagsByIds') + ->with(['invalid']) ->will($this->throwException(new \InvalidArgumentException())); $this->node->childExists('invalid'); diff --git a/apps/dav/tests/unit/systemtag/systemtagsobjectmappingcollection.php b/apps/dav/tests/unit/systemtag/systemtagsobjectmappingcollection.php index 1a9ffa6f4ae..6e15bb78e7c 100644 --- a/apps/dav/tests/unit/systemtag/systemtagsobjectmappingcollection.php +++ b/apps/dav/tests/unit/systemtag/systemtagsobjectmappingcollection.php @@ -76,13 +76,13 @@ class SystemTagsObjectMappingCollection extends \Test\TestCase { $this->tagMapper->expects($this->once()) ->method('haveTag') - ->with(111, 'files', '555', true) + ->with([111], 'files', '555', true) ->will($this->returnValue(true)); $this->tagManager->expects($this->once()) - ->method('getTagsById') - ->with('555') - ->will($this->returnValue([$tag])); + ->method('getTagsByIds') + ->with(['555']) + ->will($this->returnValue(['555' => $tag])); $childNode = $this->node->getChild('555'); @@ -96,7 +96,7 @@ class SystemTagsObjectMappingCollection extends \Test\TestCase { public function testGetChildRelationNotFound() { $this->tagMapper->expects($this->once()) ->method('haveTag') - ->with(111, 'files', '777') + ->with([111], 'files', '777') ->will($this->returnValue(false)); $this->node->getChild('777'); @@ -108,7 +108,7 @@ class SystemTagsObjectMappingCollection extends \Test\TestCase { public function testGetChildInvalidId() { $this->tagMapper->expects($this->once()) ->method('haveTag') - ->with(111, 'files', 'badid') + ->with([111], 'files', 'badid') ->will($this->throwException(new \InvalidArgumentException())); $this->node->getChild('badid'); @@ -120,7 +120,7 @@ class SystemTagsObjectMappingCollection extends \Test\TestCase { public function testGetChildTagDoesNotExist() { $this->tagMapper->expects($this->once()) ->method('haveTag') - ->with(111, 'files', '777') + ->with([111], 'files', '777') ->will($this->throwException(new TagNotFoundException())); $this->node->getChild('777'); @@ -132,11 +132,11 @@ class SystemTagsObjectMappingCollection extends \Test\TestCase { $this->tagMapper->expects($this->once()) ->method('getTagIdsForObjects') - ->with(111, 'files') + ->with([111], 'files') ->will($this->returnValue(['111' => ['555', '556']])); $this->tagManager->expects($this->once()) - ->method('getTagsById') + ->method('getTagsByIds') ->with(['555', '556']) ->will($this->returnValue(['555' => $tag1, '666' => $tag2])); @@ -159,7 +159,7 @@ class SystemTagsObjectMappingCollection extends \Test\TestCase { public function testChildExists() { $this->tagMapper->expects($this->once()) ->method('haveTag') - ->with(111, 'files', '555') + ->with([111], 'files', '555') ->will($this->returnValue(true)); $this->assertTrue($this->node->childExists('555')); @@ -168,7 +168,7 @@ class SystemTagsObjectMappingCollection extends \Test\TestCase { public function testChildExistsNotFound() { $this->tagMapper->expects($this->once()) ->method('haveTag') - ->with(111, 'files', '555') + ->with([111], 'files', '555') ->will($this->returnValue(false)); $this->assertFalse($this->node->childExists('555')); @@ -177,7 +177,7 @@ class SystemTagsObjectMappingCollection extends \Test\TestCase { public function testChildExistsTagNotFound() { $this->tagMapper->expects($this->once()) ->method('haveTag') - ->with(111, 'files', '555') + ->with([111], 'files', '555') ->will($this->throwException(new TagNotFoundException())); $this->assertFalse($this->node->childExists('555')); @@ -189,7 +189,7 @@ class SystemTagsObjectMappingCollection extends \Test\TestCase { public function testChildExistsInvalidId() { $this->tagMapper->expects($this->once()) ->method('haveTag') - ->with(111, 'files', '555') + ->with([111], 'files', '555') ->will($this->throwException(new \InvalidArgumentException())); $this->node->childExists('555'); |