diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-11 15:48:50 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-11 15:48:50 +0200 |
commit | 80707aa9e3c2925b4ae995661013be622963c217 (patch) | |
tree | bfd86604827bc9ca6bb86292467a18afd8924322 /tests | |
parent | 7808ff902b745b8e7d2fabb5f941d818b0dc78fd (diff) |
translate folder and feed errors and added css and template code for creating folders and feeds and what happens when an error gets triggered
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/bl/FeedBlTest.php | 12 | ||||
-rw-r--r-- | tests/unit/bl/FolderBlTest.php | 16 |
2 files changed, 26 insertions, 2 deletions
diff --git a/tests/unit/bl/FeedBlTest.php b/tests/unit/bl/FeedBlTest.php index 92c472834..b1c5ba3c8 100644 --- a/tests/unit/bl/FeedBlTest.php +++ b/tests/unit/bl/FeedBlTest.php @@ -78,6 +78,12 @@ class FeedBlTest extends \OCA\AppFramework\Utility\TestUtility { public function testCreateDoesNotFindFeed(){ $ex = new FetcherException('hi'); $url = 'test'; + $trans = $this->getMock('Trans', array('t')); + $trans->expects($this->once()) + ->method('t'); + $this->api->expects($this->once()) + ->method('getTrans') + ->will($this->returnValue($trans)); $this->mapper->expects($this->once()) ->method('findByUrlHash') ->with($this->equalTo(md5($url)), $this->equalTo($this->user)) @@ -128,6 +134,12 @@ class FeedBlTest extends \OCA\AppFramework\Utility\TestUtility { public function testCreateFeedExistsAlready(){ $url = 'test'; + $trans = $this->getMock('Trans', array('t')); + $trans->expects($this->once()) + ->method('t'); + $this->api->expects($this->once()) + ->method('getTrans') + ->will($this->returnValue($trans)); $this->mapper->expects($this->once()) ->method('findByUrlHash') ->with($this->equalTo(md5($url)), $this->equalTo($this->user)); diff --git a/tests/unit/bl/FolderBlTest.php b/tests/unit/bl/FolderBlTest.php index 1bf2cd3ce..f99dfda9e 100644 --- a/tests/unit/bl/FolderBlTest.php +++ b/tests/unit/bl/FolderBlTest.php @@ -43,7 +43,7 @@ class FolderBlTest extends \OCA\AppFramework\Utility\TestUtility { '\OCA\News\Db\FolderMapper') ->disableOriginalConstructor() ->getMock(); - $this->folderBl = new FolderBl($this->folderMapper); + $this->folderBl = new FolderBl($this->folderMapper, $this->api); } @@ -83,7 +83,13 @@ class FolderBlTest extends \OCA\AppFramework\Utility\TestUtility { $rows = array( array('id' => 1) ); - + + $trans = $this->getMock('Trans', array('t')); + $trans->expects($this->once()) + ->method('t'); + $this->api->expects($this->once()) + ->method('getTrans') + ->will($this->returnValue($trans)); $this->folderMapper->expects($this->once()) ->method('findByName') ->with($this->equalTo($folderName)) @@ -138,6 +144,12 @@ class FolderBlTest extends \OCA\AppFramework\Utility\TestUtility { array('id' => 1) ); + $trans = $this->getMock('Trans', array('t')); + $trans->expects($this->once()) + ->method('t'); + $this->api->expects($this->once()) + ->method('getTrans') + ->will($this->returnValue($trans)); $this->folderMapper->expects($this->once()) ->method('findByName') ->with($this->equalTo($folderName)) |