summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-06-16 17:18:06 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-06-23 12:37:43 +0200
commitab814e77861d3cba7089e073483ae4e11c67096c (patch)
tree41d8e99abf69f0cd1cdf9dae3aba15cb99093add /tests
parent1cdb49d6dbfe071f7d612dd4364cbc0c71abacde (diff)
downloadnextcloud-server-ab814e77861d3cba7089e073483ae4e11c67096c.tar.gz
nextcloud-server-ab814e77861d3cba7089e073483ae4e11c67096c.zip
drone wasn't satisfied yet
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/Settings/Controller/AdminSettingsControllerTest.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/Settings/Controller/AdminSettingsControllerTest.php b/tests/Settings/Controller/AdminSettingsControllerTest.php
index 1d4d6eb9dbb..51357f67a2d 100644
--- a/tests/Settings/Controller/AdminSettingsControllerTest.php
+++ b/tests/Settings/Controller/AdminSettingsControllerTest.php
@@ -46,6 +46,8 @@ class AdminSettingsControllerTest extends TestCase {
private $navigationManager;
/** @var IManager|\PHPUnit_Framework_MockObject_MockObject */
private $settingsManager;
+ /** @var string */
+ private $adminUid = 'lololo';
public function setUp() {
parent::setUp();
@@ -60,6 +62,16 @@ class AdminSettingsControllerTest extends TestCase {
$this->navigationManager,
$this->settingsManager
);
+
+ $user = \OC::$server->getUserManager()->createUser($this->adminUid, 'olo');
+ \OC_User::setUserId($user->getUID());
+ \OC::$server->getGroupManager()->createGroup('admin')->addUser($user);
+ }
+
+ public function tearDown() {
+ \OC::$server->getUserManager()->get($this->adminUid)->delete();
+
+ parent::tearDown();
}
public function testIndex() {
@@ -77,11 +89,6 @@ class AdminSettingsControllerTest extends TestCase {
->with('test')
->willReturn([5 => new TipsTricks($this->getMockBuilder('\OCP\IConfig')->getMock())]);
- // 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'));
}