summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-05-23 01:25:55 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-05-23 01:25:55 +0200
commit4eaee79d9b27d9131bd862725dbe90ba54eec254 (patch)
tree4b6de904b6167d7ed6070d24e7f41ff8c5f6c500 /tests
parent7af31802517eb31a05e1c5d248a8c502d9d8b943 (diff)
implement #137 serverside
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/controller/FeedControllerTest.php14
-rw-r--r--tests/unit/service/FeedServiceTest.php5
2 files changed, 11 insertions, 8 deletions
diff --git a/tests/unit/controller/FeedControllerTest.php b/tests/unit/controller/FeedControllerTest.php
index c756875d2..fc46594a8 100644
--- a/tests/unit/controller/FeedControllerTest.php
+++ b/tests/unit/controller/FeedControllerTest.php
@@ -229,10 +229,11 @@ class FeedControllerTest extends \PHPUnit_Framework_TestCase {
->method('create')
->with($this->equalTo('hi'),
$this->equalTo(4),
- $this->equalTo($this->user))
+ $this->equalTo($this->user),
+ $this->equalTo('yo'))
->will($this->returnValue($result['feeds'][0]));
- $response = $this->controller->create('hi', 4);
+ $response = $this->controller->create('hi', 4, 'yo');
$this->assertEquals($result, $response);
}
@@ -253,10 +254,11 @@ class FeedControllerTest extends \PHPUnit_Framework_TestCase {
->method('create')
->with($this->equalTo('hi'),
$this->equalTo(4),
- $this->equalTo($this->user))
+ $this->equalTo($this->user),
+ $this->equalTo('yo'))
->will($this->returnValue($result['feeds'][0]));
- $response = $this->controller->create('hi', 4);
+ $response = $this->controller->create('hi', 4, 'yo');
$this->assertEquals($result, $response);
}
@@ -272,7 +274,7 @@ class FeedControllerTest extends \PHPUnit_Framework_TestCase {
->method('create')
->will($this->throwException($ex));
- $response = $this->controller->create('hi', 4);
+ $response = $this->controller->create('hi', 4, 'test');
$params = json_decode($response->render(), true);
$this->assertEquals($msg, $params['message']);
@@ -290,7 +292,7 @@ class FeedControllerTest extends \PHPUnit_Framework_TestCase {
->method('create')
->will($this->throwException($ex));
- $response = $this->controller->create('hi', 4);
+ $response = $this->controller->create('hi', 4, 'test');
$params = json_decode($response->render(), true);
$this->assertEquals($msg, $params['message']);
diff --git a/tests/unit/service/FeedServiceTest.php b/tests/unit/service/FeedServiceTest.php
index d4174b245..2ec1d7a9b 100644
--- a/tests/unit/service/FeedServiceTest.php
+++ b/tests/unit/service/FeedServiceTest.php
@@ -116,6 +116,7 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase {
$createdFeed->setUrl($url);
$createdFeed->setUrlHash('hsssi');
$createdFeed->setLink($url);
+ $createdFeed->setTitle('hehoy');
$item1 = new Item();
$item1->setGuidHash('hi');
$item2 = new Item();
@@ -203,7 +204,7 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase {
$this->feedMapper->expects($this->once())
->method('findByUrlHash')
- ->with($this->equalTo($createdFeed->getUrlHash()),
+ ->with($this->equalTo($createdFeed->getUrlHash()),
$this->equalTo($this->user))
->will($this->throwException($ex));
$this->fetcher->expects($this->once())
@@ -601,7 +602,7 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase {
$this->itemMapper->expects($this->at(1))
->method('insert')
->with($this->equalTo($item));
-
+
$this->itemMapper->expects($this->at(2))
->method('findByGuidHash')
->will($this->returnValue($item));