3 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);
59 $this->db_mock->expects($this->any())
62 ->willReturnOnConsecutiveCalls(21, 22, 23);
64 $str =
'2022-04-28 08:00:00';
65 $this->db_mock->expects($this->any())
66 ->method(
'fetchAssoc')
67 ->willReturnOnConsecutiveCalls(
68 [
'last_update' => $str,
'create_date' => $str],
69 [
'last_update' => $str,
'create_date' => $str],
70 [
'last_update' => $str,
'create_date' => $str]
75 $this->assertEquals(21,
$id);
79 $this->assertEquals(22,
$id);
83 $this->assertEquals(23,
$id);
ILIAS DI Container $dic_backup
Customizing of pimple-DIC for ILIAS.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins