ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestPassDeletionConfirmationGUITest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
26 {
28 
29  private $lng_mock;
30 
31  private $ctrl_mock;
32 
33  protected function setUp(): void
34  {
35  parent::setUp();
36  $this->testEvaluationGUI_mock = $this->createMock(ilTestEvaluationGUI::class);
37  $this->lng_mock = $this->createMock(ilLanguage::class);
38  $this->ctrl_mock = $this->createMock(ilCtrl::class);
39  }
40 
42  {
43  $instance = new ilTestPassDeletionConfirmationGUI(
44  $this->ctrl_mock,
45  $this->lng_mock,
46  $this->testEvaluationGUI_mock
47  );
48 
49  $this->assertInstanceOf(ilTestPassDeletionConfirmationGUI::class, $instance);
50  }
51 
52  public function testConstructor(): void
53  {
54  $this->ctrl_mock->expects($this->once())
55  ->method("getFormAction")
56  ->with($this->testEvaluationGUI_mock);
57 
58  new ilTestPassDeletionConfirmationGUI($this->ctrl_mock, $this->lng_mock, $this->testEvaluationGUI_mock);
59  }
60 
61  public function testBuildFailsWithWrongContext(): void
62  {
63  $gui = new ilTestPassDeletionConfirmationGUI($this->ctrl_mock, $this->lng_mock, $this->testEvaluationGUI_mock);
64  $this->expectException(ilTestException::class);
65  $gui->build(20, 5, "invalidContext");
66  }
67 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilTestBaseClass.