Skip to content

Commit

Permalink
Fixed the SecurityTest error
Browse files Browse the repository at this point in the history
Signed-off-by: Greta Doci <[email protected]>
  • Loading branch information
GretaD committed Sep 14, 2019
1 parent e130859 commit fdd0cfe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion settings/Settings/Personal/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@

class Security implements ISettings {

/** @var IInitialStateService */
private $initialStateService;

/** @var IUserManager */
private $userManager;

Expand All @@ -61,11 +64,13 @@ class Security implements ISettings {
/** @var IConfig */
private $config;

public function __construct(IUserManager $userManager,
public function __construct(IInitialStateService $initialStateService,
IUserManager $userManager,
ProviderLoader $providerLoader,
IUserSession $userSession,
IConfig $config,
?string $UserId) {
$this->initialStateService = $initialStateService;
$this->userManager = $userManager;
$this->providerLoader = $providerLoader;
$this->userSession = $userSession;
Expand Down
7 changes: 7 additions & 0 deletions tests/lib/Settings/Personal/SecurityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
namespace Test\Settings\Personal;

use OC\Authentication\TwoFactorAuth\ProviderLoader;
use OCP\IInitialStateService;
use OCP\InitialStateService;
use OC\Settings\Personal\Security;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
Expand All @@ -36,6 +38,9 @@

class SecurityTest extends TestCase {

/** @var InitialStateService|MockObject */
private $initialStateService;

/** @var IUserManager|MockObject */
private $userManager;

Expand All @@ -57,13 +62,15 @@ class SecurityTest extends TestCase {
public function setUp() {
parent::setUp();

$this->initialStateService = $this->createMock(IInitialStateService::class);
$this->userManager = $this->createMock(IUserManager::class);
$this->providerLoader = $this->createMock(ProviderLoader::class);
$this->userSession = $this->createMock(IUserSession::class);
$this->config = $this->createMock(IConfig::class);
$this->uid = 'test123';

$this->section = new Security(
$this->initialStateService,
$this->userManager,
$this->providerLoader,
$this->userSession,
Expand Down

0 comments on commit fdd0cfe

Please sign in to comment.