diff options
Diffstat (limited to 'tests/unit/businesslayer/FolderBusinessLayerTest.php')
-rw-r--r-- | tests/unit/businesslayer/FolderBusinessLayerTest.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/unit/businesslayer/FolderBusinessLayerTest.php b/tests/unit/businesslayer/FolderBusinessLayerTest.php index d28c078a5..7f512920e 100644 --- a/tests/unit/businesslayer/FolderBusinessLayerTest.php +++ b/tests/unit/businesslayer/FolderBusinessLayerTest.php @@ -115,6 +115,22 @@ class FolderBusinessLayerTest extends \OCA\AppFramework\Utility\TestUtility { } + public function testCreateThrowsExWhenFolderNameEmpty(){ + $folderName = ''; + $rows = array( + array('id' => 1) + ); + + $this->folderMapper->expects($this->once()) + ->method('findByName') + ->with($this->equalTo($folderName)) + ->will($this->returnValue(array())); + + $this->setExpectedException('\OCA\News\BusinessLayer\BusinessLayerValidationException'); + $result = $this->folderBusinessLayer->create($folderName, 'john', 3); + } + + public function testOpen(){ $folder = new Folder(); @@ -175,6 +191,22 @@ class FolderBusinessLayerTest extends \OCA\AppFramework\Utility\TestUtility { } + public function testRenameThrowsExWhenFolderNameEmpty(){ + $folderName = ''; + $rows = array( + array('id' => 1) + ); + + $this->folderMapper->expects($this->once()) + ->method('findByName') + ->with($this->equalTo($folderName)) + ->will($this->returnValue(array())); + + $this->setExpectedException('\OCA\News\BusinessLayer\BusinessLayerException'); + $result = $this->folderBusinessLayer->rename(3, $folderName, 'john'); + } + + public function testMarkDeleted() { $id = 3; $folder = new Folder(); |