3 declare(strict_types=1);
34 protected function setUp(): void
42 $this->getMockBuilder(ilDBInterface::class)->disableAutoReturnValueGeneration()->getMock()
47 $this->getMockBuilder(\
ILIAS\Administration\Setting::class)->getMock()
51 $this->getMockBuilder(ilErrorHandling::class)->getMock()
67 $DIC[$name] =
static function (
$c) use ($name) {
78 ->getMockBuilder(ilLanguage::class)
79 ->disableOriginalConstructor()
80 ->onlyMethods([
'txt',
'getInstalledLanguages',
'loadLanguageModule'])
86 public function testConstructorWithoutParam():
void 92 $setting = $DIC[
'ilSetting'];
93 $setting->method(
"get")->willReturnCallback(
95 if ($arg ===
'session_handling_type') {
98 if ($arg ===
'session_statistics') {
102 throw new \RuntimeException($arg);
107 $ilDB = $DIC[
'ilDB'];
108 $ilDB->expects($this->never())->method(
"quote");
111 $this->assertFalse(
$server->isActive());
114 public function testConstructorWithParameter():
void 120 $setting = $DIC[
'ilSetting'];
121 $setting->method(
"get")->willReturnCallback(
123 if ($arg ===
'session_handling_type') {
126 if ($arg ===
'session_statistics') {
130 throw new \RuntimeException($arg);
135 $ilDB = $DIC[
'ilDB'];
136 $ilDB->expects($this->once())->method(
"quote")->with(1)->willReturn(
"1");
138 $res = $this->getMockBuilder(ilDBStatement::class)->disableAutoReturnValueGeneration()->getMock();
139 $ilDB->method(
"query")->with(
140 "SELECT * FROM ldap_server_settings WHERE server_id = 1" 143 $res->expects($this->exactly(2))->method(
"fetchRow")->willReturnOnConsecutiveCalls((
object) array(
145 'name' =>
"testserver",
146 'url' =>
"ldap://testurl:389",
149 'referrals' =>
"false",
152 'bind_user' =>
"nobody",
153 'bind_pass' =>
"password",
154 'search_base' =>
"dc=de",
156 'user_attribute' =>
"user",
158 'group_dn' =>
"dc=group",
159 'group_scope' =>
"1",
160 'group_filter' =>
"",
161 'group_member' =>
"",
162 'group_attribute' =>
"",
163 'group_optional' =>
"false",
164 'group_user_filter' =>
".*",
165 'group_memberisdn' =>
"true",
167 'sync_on_login' =>
"true",
168 'sync_per_cron' =>
"false",
169 'role_sync_active' =>
"true",
170 'role_bind_dn' =>
"rolebind",
171 'role_bind_pass' =>
"rolebindpwd",
172 'migration' =>
"true",
173 'authentication' =>
"true",
174 'authentication_type' =>
"1",
175 'username_filter' =>
".*",
176 'escape_dn' =>
"false" 180 $this->assertTrue(
$server->isActive());
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
const SESSION_HANDLING_FIXED
Customizing of pimple-DIC for ILIAS.
setGlobalVariable(string $name, $value)