ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestPassDeletionConfirmationGUITest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
28 {
29  private MockObject $testEvaluationGUI_mock;
30 
31  private MockObject $lng_mock;
32 
33  private MockObject $ctrl_mock;
34 
35  protected function setUp(): void
36  {
37  parent::setUp();
38  $this->testEvaluationGUI_mock = $this->createMock(ilTestEvaluationGUI::class);
39  $this->lng_mock = $this->createMock(ilLanguage::class);
40  $this->ctrl_mock = $this->createMock(ilCtrl::class);
41  }
42 
44  {
45  $instance = new ilTestPassDeletionConfirmationGUI(
46  $this->ctrl_mock,
47  $this->lng_mock,
48  $this->testEvaluationGUI_mock
49  );
50 
51  $this->assertInstanceOf(ilTestPassDeletionConfirmationGUI::class, $instance);
52  }
53 
54  public function testConstructor(): void
55  {
56  $this->ctrl_mock
57  ->expects($this->once())
58  ->method('getFormAction')
59  ->with($this->testEvaluationGUI_mock);
60 
61  new ilTestPassDeletionConfirmationGUI($this->ctrl_mock, $this->lng_mock, $this->testEvaluationGUI_mock);
62  }
63 
64  public function testBuildFailsWithWrongContext(): void
65  {
66  $gui = new ilTestPassDeletionConfirmationGUI($this->ctrl_mock, $this->lng_mock, $this->testEvaluationGUI_mock);
67  $this->expectException(ilTestException::class);
68  $gui->build(20, 5, 'invalidContext');
69  }
70 }
Class ilTestPassDeletionConfirmationGUITest.