ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTestPassDeletionConfirmationGUITest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use PHPUnit\Framework\MockObject\MockObject;
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 {
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 ilTestBaseClass.
Class ilTestPassDeletionConfirmationGUITest.