From ef2af010a63bfcf511cdf648e9358a3956d97739 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 20 Mar 2013 23:00:39 +0100 Subject: finished folder businesslayer --- tests/bl/FeedBlTest.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'tests/bl/FeedBlTest.php') diff --git a/tests/bl/FeedBlTest.php b/tests/bl/FeedBlTest.php index 01301b91f..dca99c682 100644 --- a/tests/bl/FeedBlTest.php +++ b/tests/bl/FeedBlTest.php @@ -47,7 +47,7 @@ class FolderBlTest extends \OCA\AppFramework\Utility\TestUtility { } - function testGetAll(){ + function testFindAll(){ $userId = 'jack'; $return = 'hi'; $this->folderMapper->expects($this->once()) @@ -55,7 +55,7 @@ class FolderBlTest extends \OCA\AppFramework\Utility\TestUtility { ->with($this->equalTo($userId)) ->will($this->returnValue($return)); - $result = $this->folderBl->getAll($userId); + $result = $this->folderBl->findAll($userId); $this->assertEquals($return, $result); } @@ -95,4 +95,23 @@ class FolderBlTest extends \OCA\AppFramework\Utility\TestUtility { } + + public function testRename(){ + $folder = new Folder(); + $folder->setName('jooohn'); + + $this->folderMapper->expects($this->once()) + ->method('find') + ->with($this->equalTo(3)) + ->will($this->returnValue($folder)); + + $this->folderMapper->expects($this->once()) + ->method('update') + ->with($this->equalTo($folder)); + + $this->folderBl->rename(3, 'bogus', ''); + + $this->assertEquals('bogus', $folder->getName()); + } + } -- cgit v1.2.3