diff options
author | Sean Molenaar <sean@seanmolenaar.eu> | 2021-01-02 17:57:17 +0100 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2021-02-13 13:22:57 +0100 |
commit | b4fa772bc5f23f84fc292f5d6bf884543d2bfe51 (patch) | |
tree | 8576ad3ea145f3644804e2fd93de462cfc2c2578 /tests/Unit/Controller/PageControllerTest.php | |
parent | ceba81060303e49b2617397397f2804516052ec9 (diff) |
Remove V1 item API
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'tests/Unit/Controller/PageControllerTest.php')
-rw-r--r-- | tests/Unit/Controller/PageControllerTest.php | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/Unit/Controller/PageControllerTest.php b/tests/Unit/Controller/PageControllerTest.php index 2f259b316..5f62bfe9f 100644 --- a/tests/Unit/Controller/PageControllerTest.php +++ b/tests/Unit/Controller/PageControllerTest.php @@ -16,6 +16,7 @@ namespace OCA\News\Tests\Unit\Controller; use OC\L10N\L10N; use OCA\News\Controller\PageController; use \OCA\News\Db\FeedType; +use OCA\News\Explore\Exceptions\RecommendedSiteNotFoundException; use OCA\News\Explore\RecommendedSites; use OCA\News\Service\StatusService; use OCP\IConfig; @@ -26,7 +27,6 @@ use OCP\IUser; use OCP\IUserSession; use PHPUnit\Framework\TestCase; - class PageControllerTest extends TestCase { @@ -278,4 +278,24 @@ class PageControllerTest extends TestCase } + public function testExploreError() + { + $this->settings->expects($this->exactly(2)) + ->method('setUserValue') + ->withConsecutive( + ['becka', 'news', 'lastViewedFeedId', 0], + ['becka', 'news', 'lastViewedFeedType', FeedType::EXPLORE] + ); + + $this->recommended->expects($this->once()) + ->method('forLanguage') + ->with('nl') + ->will($this->throwException(new RecommendedSiteNotFoundException('error'))); + + $out = $this->controller->explore('nl'); + + $this->assertEquals(404, $out->getStatus()); + + } + } |