summaryrefslogtreecommitdiffstats
path: root/tests/Settings
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-06-16 16:50:13 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-06-23 12:37:42 +0200
commit1cdb49d6dbfe071f7d612dd4364cbc0c71abacde (patch)
treed771d8592e0f11510c9e74c5ad6a4ae1d51bd51d /tests/Settings
parent0762d3dd3e4153455c70e175ae67690d57b9a5d1 (diff)
downloadnextcloud-server-1cdb49d6dbfe071f7d612dd4364cbc0c71abacde.tar.gz
nextcloud-server-1cdb49d6dbfe071f7d612dd4364cbc0c71abacde.zip
adjust another test
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'tests/Settings')
-rw-r--r--tests/Settings/Controller/AdminSettingsControllerTest.php22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/Settings/Controller/AdminSettingsControllerTest.php b/tests/Settings/Controller/AdminSettingsControllerTest.php
index 6c93bca0d68..1d4d6eb9dbb 100644
--- a/tests/Settings/Controller/AdminSettingsControllerTest.php
+++ b/tests/Settings/Controller/AdminSettingsControllerTest.php
@@ -22,7 +22,6 @@
*/
namespace Tests\Settings\Controller;
-
use OC\Settings\Admin\TipsTricks;
use OC\Settings\Controller\AdminSettingsController;
use OCP\AppFramework\Http\TemplateResponse;
@@ -31,6 +30,13 @@ use OCP\IRequest;
use OCP\Settings\IManager;
use Test\TestCase;
+/**
+ * Class AdminSettingsControllerTest
+ *
+ * @group DB
+ *
+ * @package Tests\Settings\Controller
+ */
class AdminSettingsControllerTest extends TestCase {
/** @var AdminSettingsController */
private $adminSettingsController;
@@ -38,7 +44,7 @@ class AdminSettingsControllerTest extends TestCase {
private $request;
/** @var INavigationManager */
private $navigationManager;
- /** @var IManager */
+ /** @var IManager|\PHPUnit_Framework_MockObject_MockObject */
private $settingsManager;
public function setUp() {
@@ -63,10 +69,20 @@ class AdminSettingsControllerTest extends TestCase {
->willReturn([]);
$this->settingsManager
->expects($this->once())
+ ->method('getPersonalSections')
+ ->willReturn([]);
+ $this->settingsManager
+ ->expects($this->once())
->method('getAdminSettings')
->with('test')
->willReturn([5 => new TipsTricks($this->getMockBuilder('\OCP\IConfig')->getMock())]);
- $expected = new TemplateResponse('settings', 'admin/frame', ['forms' => [], 'content' => '']);
+
+ // so unity…
+ $user = \OC::$server->getUserManager()->createUser('lolo', 'olo');
+ \OC_User::setUserId($user->getUID());
+ \OC::$server->getGroupManager()->get('admin')->addUser($user);
+
+ $expected = new TemplateResponse('settings', 'settings/frame', ['forms' => ['personal' => [], 'admin' => []], 'content' => '']);
$this->assertEquals($expected, $this->adminSettingsController->index('test'));
}
}