19 declare(strict_types=1);
32 protected function setUp(): void
35 $this->dic_backup = is_object($DIC) ? clone
$DIC :
$DIC;
38 $DIC[
'ilias'] = $this->createMock(ILIAS::class);
39 $DIC[
'objDefinition'] = $this->createMock(ilObjectDefinition::class);
40 $DIC[
'ilDB'] = $this->db_mock = $this->createMock(ilDBInterface::class);
41 $DIC[
'ilLog'] = $this->createMock(ilLogger::class);
42 $DIC[
'ilErr'] = $this->createMock(ilErrorHandling::class);
43 $DIC[
'tree'] = $this->createMock(ilTree::class);
44 $DIC[
'ilAppEventHandler'] = $this->createMock(ilAppEventHandler::class);
45 $DIC[
'ilUser'] = $this->createMock(ilObjUser::class);
47 if (!defined(
'ILIAS_LOG_DIR')) {
48 define(
'ILIAS_LOG_DIR',
'/var/log');
51 if (!defined(
'ILIAS_LOG_ENABLED')) {
52 define(
'ILIAS_LOG_ENABLED',
true);
67 $this->db_mock->expects($this->any())
70 ->willReturnOnConsecutiveCalls(21, 22, 23);
72 $str =
'2022-04-28 08:00:00';
73 $this->db_mock->expects($this->any())
74 ->method(
'fetchAssoc')
75 ->willReturnOnConsecutiveCalls(
76 [
'last_update' => $str,
'create_date' => $str],
77 [
'last_update' => $str,
'create_date' => $str],
78 [
'last_update' => $str,
'create_date' => $str]
83 $this->assertEquals(21,
$id);
87 $this->assertEquals(22,
$id);
91 $this->assertEquals(23,
$id);
ILIAS DI Container $dic_backup
Customizing of pimple-DIC for ILIAS.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins