drone wasn't satisfied yet

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2017-06-16 17:18:06 +02:00
parent 1cdb49d6db
commit ab814e7786
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
1 changed files with 12 additions and 5 deletions

View File

@ -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'));
}