ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
QuestionsTableTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 
32 {
34 
35  protected function setUp(): void
36  {
37  global $DIC;
38  parent::setUp();
39  $this->addGlobal_uiFactory();
40  $this->addGlobal_refinery();
41  $this->addGlobal_http();
42  $this->addGlobal_lng();
43 
44  $obj_test = $this->getMockBuilder(\ilObjTest::class)
45  ->disableOriginalConstructor()
46  ->getMock();
47 
48 
49  $actions = $this->getMockBuilder(QuestionsTableActions::class)
50  ->disableOriginalConstructor()
51  ->getMock();
52  $actions->expects($this->any())
53  ->method('getQuestionTargetLinkBuilder')
54  ->willReturn(fn(int $q): string => '');
55 
56  $questionrepository = $this->getMockBuilder(QuestionsRepository::class)
57  ->disableOriginalConstructor()
58  ->getMock();
59  $questionrepository->expects($this->any())
60  ->method('getQuestionPropertiesWithAggregatedResultsForTest')
61  ->willReturn(
62  [
63  new \ILIAS\Test\Questions\Properties\Properties(
64  77,
65  new \ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties(
66  $this->createMock(\ilComponentFactory::class),
67  77,
68  88,
69  null,
70  0,
71  null,
72  7,
73  '',
74  0,
75  'question one',
76  'description one',
77  '',
78  3
79  )
80  )
81  ]
82  );
83 
84  $title_builder = $this->createMock(\ILIAS\Test\Utilities\TitleColumnsBuilder::class);
85 
86  $this->table_gui = new QuestionsTable(
87  $DIC['ui.factory'],
88  $DIC['refinery'],
89  $DIC['http']->request(),
90  $actions,
91  $DIC['lng'],
92  $obj_test,
93  $questionrepository,
94  $title_builder,
95  );
96  }
97 
99  {
100  $this->assertInstanceOf(QuestionsTable::class, $this->table_gui);
101  }
102 
104  {
105  $this->assertInstanceOf(Table\Ordering::class, $this->table_gui->getTableComponent());
106  }
107 }
Interface Observer Contains several chained tasks and infos about them.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:26
Class ilTestBaseClass.
$q
Definition: shib_logout.php:23