ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilSessionTest Class Reference

Class ilSessionTest. More...

+ Inheritance diagram for ilSessionTest:
+ Collaboration diagram for ilSessionTest:

Public Member Functions

 testPasswordAssisstanceSession ()
 

Protected Member Functions

 setUp ()
 
 setGlobalVariable (string $name, $value)
 

Protected Attributes

Container $dic
 

Detailed Description

Class ilSessionTest.

Definition at line 30 of file ilSessionTest.php.

Member Function Documentation

◆ setGlobalVariable()

ilSessionTest::setGlobalVariable ( string  $name,
  $value 
)
protected
Parameters
string$name
mixed$value

Definition at line 67 of file ilSessionTest.php.

References Vendor\Package\$c, $data, $DIC, $GLOBALS, $ilDB, ilSession\_destroy(), ilSession\_destroyByUserId(), ilSession\_destroyExpiredSessions(), ilSession\_duplicate(), ilSession\_exists(), ilSession\_getData(), and ilSession\SESSION_HANDLING_FIXED.

Referenced by setUp().

67  : void
68  {
69  global $DIC;
70 
71  $GLOBALS[$name] = $value;
72 
73  unset($DIC[$name]);
74  $DIC[$name] = static function ($c) use ($name) {
75  return $GLOBALS[$name];
76  };
77  }
global $DIC
Definition: feed.php:28
$GLOBALS["DIC"]
Definition: wac.php:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUp()

ilSessionTest::setUp ( )
protected

Definition at line 34 of file ilSessionTest.php.

References $dic, $GLOBALS, and setGlobalVariable().

34  : void
35  {
36  $this->dic = new Container();
37  $GLOBALS['DIC'] = $this->dic;
38 
39  //$this->setGlobalVariable('lng', $this->getLanguageMock());
40  $this->setGlobalVariable(
41  'ilCtrl',
42  $this->getMockBuilder(ilCtrl::class)->disableOriginalConstructor()->getMock()
43  );
44  $this->setGlobalVariable(
45  'ilUser',
46  $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock()
47  );
48  $this->setGlobalVariable(
49  'ilDB',
50  $this->getMockBuilder(ilDBInterface::class)->disableAutoReturnValueGeneration()->getMock()
51  );
52  $this->setGlobalVariable(
53  'ilClientIniFile',
54  $this->getMockBuilder(ilIniFile::class)->disableOriginalConstructor()->getMock()
55  );
56  $this->setGlobalVariable(
57  'ilSetting',
58  $this->getMockBuilder(\ILIAS\Administration\Setting::class)->getMock()
59  );
60  parent::setUp();
61  }
setGlobalVariable(string $name, $value)
Class ChatMainBarProvider .
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
$GLOBALS["DIC"]
Definition: wac.php:31
Container $dic
+ Here is the call graph for this function:

◆ testPasswordAssisstanceSession()

ilSessionTest::testPasswordAssisstanceSession ( )

Definition at line 213 of file ilSessionTest.php.

References $DIC, $res, db_pwassist_session_destroy(), db_pwassist_session_find(), db_pwassist_session_gc(), db_pwassist_session_read(), and db_pwassist_session_write().

213  : void
214  {
215  global $DIC;
216 
217  $ilUser = $DIC['ilUser'];
218 
219  $result = "";
220  $this->markTestIncomplete(
221  'This test has not been implemented yet.'
222  );
223  return;
224  // write session
225  db_pwassist_session_write("12345", 60, $ilUser->getId());
226 
227  // find
228  $res = db_pwassist_session_find($ilUser->getId());
229  if ($res["pwassist_id"] === "12345") {
230  $result .= "find-";
231  }
232 
233  // read
234  $res = db_pwassist_session_read("12345");
235  if ((int) $res["user_id"] === $ilUser->getId()) {
236  $result .= "read-";
237  }
238 
239  // destroy
241  $res = db_pwassist_session_read("12345");
242  if (!$res) {
243  $result .= "destroy-";
244  }
245 
247 
248  $this->assertEquals("find-read-destroy-", $result);// TODO PHP8-REVIEW This method does not exists (because this class has no parent class)
249  }
$res
Definition: ltiservices.php:69
db_pwassist_session_destroy(string $pwassist_id)
global $DIC
Definition: feed.php:28
db_pwassist_session_read(string $pwassist_id)
db_pwassist_session_write(string $pwassist_id, int $maxlifetime, int $user_id)
db_pwassist_session_find(int $user_id)
+ Here is the call graph for this function:

Field Documentation

◆ $dic

Container ilSessionTest::$dic
protected

Definition at line 32 of file ilSessionTest.php.

Referenced by setUp().


The documentation for this class was generated from the following file: