drone wasn't satisfied yet
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
1cdb49d6db
commit
ab814e7786
|
@ -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'));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue