mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-05-05 18:43:40 +02:00
update unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
parent
179e4d5b76
commit
418d54fa2d
|
@ -94,6 +94,7 @@ class SAMLControllerTest extends TestCase {
|
|||
$this->logger,
|
||||
$this->l
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -125,6 +126,11 @@ class SAMLControllerTest extends TestCase {
|
|||
]);
|
||||
$this->config
|
||||
->expects($this->at(1))
|
||||
->method('getSystemValue')
|
||||
->with('gs.enabled', false)
|
||||
->willReturn(false);
|
||||
$this->config
|
||||
->expects($this->at(2))
|
||||
->method('getAppValue')
|
||||
->with('user_saml', 'general-uid_mapping')
|
||||
->willReturn('uid');
|
||||
|
@ -156,6 +162,11 @@ class SAMLControllerTest extends TestCase {
|
|||
]);
|
||||
$this->config
|
||||
->expects($this->at(1))
|
||||
->method('getSystemValue')
|
||||
->with('gs.enabled', false)
|
||||
->willReturn(false);
|
||||
$this->config
|
||||
->expects($this->at(2))
|
||||
->method('getAppValue')
|
||||
->with('user_saml', 'general-uid_mapping')
|
||||
->willReturn('uid');
|
||||
|
@ -205,6 +216,11 @@ class SAMLControllerTest extends TestCase {
|
|||
]);
|
||||
$this->config
|
||||
->expects($this->at(1))
|
||||
->method('getSystemValue')
|
||||
->with('gs.enabled', false)
|
||||
->willReturn(false);
|
||||
$this->config
|
||||
->expects($this->at(2))
|
||||
->method('getAppValue')
|
||||
->with('user_saml', 'general-uid_mapping')
|
||||
->willReturn('uid');
|
||||
|
@ -254,6 +270,11 @@ class SAMLControllerTest extends TestCase {
|
|||
]);
|
||||
$this->config
|
||||
->expects($this->at(1))
|
||||
->method('getSystemValue')
|
||||
->with('gs.enabled', false)
|
||||
->willReturn(false);
|
||||
$this->config
|
||||
->expects($this->at(2))
|
||||
->method('getAppValue')
|
||||
->with('user_saml', 'general-uid_mapping')
|
||||
->willReturn('uid');
|
||||
|
@ -311,6 +332,11 @@ class SAMLControllerTest extends TestCase {
|
|||
]);
|
||||
$this->config
|
||||
->expects($this->at(1))
|
||||
->method('getSystemValue')
|
||||
->with('gs.enabled', false)
|
||||
->willReturn(false);
|
||||
$this->config
|
||||
->expects($this->at(2))
|
||||
->method('getAppValue')
|
||||
->with('user_saml', 'general-uid_mapping')
|
||||
->willReturn('uid');
|
||||
|
@ -363,6 +389,11 @@ class SAMLControllerTest extends TestCase {
|
|||
]);
|
||||
$this->config
|
||||
->expects($this->at(1))
|
||||
->method('getSystemValue')
|
||||
->with('gs.enabled', false)
|
||||
->willReturn(false);
|
||||
$this->config
|
||||
->expects($this->at(2))
|
||||
->method('getAppValue')
|
||||
->with('user_saml', 'general-uid_mapping')
|
||||
->willReturn('uid');
|
||||
|
@ -402,6 +433,11 @@ class SAMLControllerTest extends TestCase {
|
|||
]);
|
||||
$this->config
|
||||
->expects($this->at(1))
|
||||
->method('getSystemValue')
|
||||
->with('gs.enabled', false)
|
||||
->willReturn(false);
|
||||
$this->config
|
||||
->expects($this->at(2))
|
||||
->method('getAppValue')
|
||||
->with('user_saml', 'general-uid_mapping')
|
||||
->willReturn('uid');
|
||||
|
|
|
@ -27,6 +27,7 @@ use OCP\IConfig;
|
|||
use OCP\IDBConnection;
|
||||
use OCP\IGroup;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\ILogger;
|
||||
use OCP\ISession;
|
||||
use OCP\IURLGenerator;
|
||||
use OCP\IUser;
|
||||
|
@ -50,6 +51,8 @@ class UserBackendTest extends TestCase {
|
|||
private $userBackend;
|
||||
/** @var \PHPUnit_Framework_MockObject_MockObject|SAMLSettings */
|
||||
private $SAMLSettings;
|
||||
/** @var \PHPUnit_Framework_MockObject_MockObject|ILogger */
|
||||
private $logger;
|
||||
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
@ -61,6 +64,7 @@ class UserBackendTest extends TestCase {
|
|||
$this->userManager = $this->createMock(IUserManager::class);
|
||||
$this->groupManager = $this->createMock(IGroupManager::class);
|
||||
$this->SAMLSettings = $this->getMockBuilder(SAMLSettings::class)->disableOriginalConstructor()->getMock();
|
||||
$this->logger = $this->createMock(ILogger::class);
|
||||
}
|
||||
|
||||
public function getMockedBuilder(array $mockedFunctions = []) {
|
||||
|
@ -73,7 +77,8 @@ class UserBackendTest extends TestCase {
|
|||
$this->db,
|
||||
$this->userManager,
|
||||
$this->groupManager,
|
||||
$this->SAMLSettings
|
||||
$this->SAMLSettings,
|
||||
$this->logger
|
||||
])
|
||||
->setMethods($mockedFunctions)
|
||||
->getMock();
|
||||
|
@ -85,7 +90,8 @@ class UserBackendTest extends TestCase {
|
|||
$this->db,
|
||||
$this->userManager,
|
||||
$this->groupManager,
|
||||
$this->SAMLSettings
|
||||
$this->SAMLSettings,
|
||||
$this->logger
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue