diff options
author | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2018-07-04 08:54:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-04 08:54:08 +0200 |
commit | 53a43e9a9627536e8cbfe32896eee2f5a4f7e578 (patch) | |
tree | e7f1b0b6f4b76485201a8036da968702e81c757e /tests/Unit/Controller/UtilityApiControllerTest.php | |
parent | 9e960afbd39f84101d67d36718436d66901f7363 (diff) | |
parent | 5c4185e22155687740e44d58c5c6bc9dc793cab7 (diff) |
Merge pull request #303 from David-Guillot/fix.adapt-to-new-login-flow
API: support new OC core login flow
Diffstat (limited to 'tests/Unit/Controller/UtilityApiControllerTest.php')
-rw-r--r-- | tests/Unit/Controller/UtilityApiControllerTest.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/Unit/Controller/UtilityApiControllerTest.php b/tests/Unit/Controller/UtilityApiControllerTest.php index 6237f3c8e..172932b0e 100644 --- a/tests/Unit/Controller/UtilityApiControllerTest.php +++ b/tests/Unit/Controller/UtilityApiControllerTest.php @@ -7,8 +7,10 @@ * * @author Alessandro Cosentino <cosenal@gmail.com> * @author Bernhard Posselt <dev@bernhard-posselt.com> + * @author David Guillot <david@guillot.me> * @copyright 2012 Alessandro Cosentino * @copyright 2012-2014 Bernhard Posselt + * @copyright 2018 David Guillot */ namespace OCA\News\Tests\Unit\Controller; @@ -20,6 +22,8 @@ class UtilityApiControllerTest extends \PHPUnit_Framework_TestCase private $settings; private $request; + private $userSession; + private $user; private $newsAPI; private $updater; private $appName; @@ -38,6 +42,19 @@ class UtilityApiControllerTest extends \PHPUnit_Framework_TestCase ) ->disableOriginalConstructor() ->getMock(); + $this->userSession = $this->getMockBuilder( + '\OCP\IUserSession' + ) + ->disableOriginalConstructor() + ->getMock(); + $this->user = $this->getMockBuilder( + '\OCP\IUser' + ) + ->disableOriginalConstructor() + ->getMock(); + $this->userSession->expects($this->any()) + ->method('getUser') + ->will($this->returnValue($this->user)); $this->updater = $this->getMockBuilder( '\OCA\News\Utility\Updater' ) @@ -49,8 +66,8 @@ class UtilityApiControllerTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); $this->newsAPI = new UtilityApiController( - $this->appName, $this->request, $this->updater, $this->settings, - $this->status + $this->appName, $this->request, $this->userSession, + $this->updater, $this->settings, $this->status ); } |