ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestPlayerConfirmationModalTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
28 
29  protected function setUp(): void
30  {
31  global $DIC;
32  parent::setUp();
33 
34  $this->testObj = new ilTestPlayerConfirmationModal($DIC['ui.renderer']);
35  }
36 
38  {
39  $this->assertInstanceOf(ilTestPlayerConfirmationModal::class, $this->testObj);
40  }
41 
42  public function testModalId(): void
43  {
44  $this->testObj->setModalId("12345");
45  $this->assertEquals("12345", $this->testObj->getModalId());
46  }
47 
48  public function testHeaderText(): void
49  {
50  $this->testObj->setHeaderText("testString");
51  $this->assertEquals("testString", $this->testObj->getHeaderText());
52  }
53 
54  public function testConfirmationText(): void
55  {
56  $this->testObj->setConfirmationText("testString");
57  $this->assertEquals("testString", $this->testObj->getConfirmationText());
58  }
59 
60  public function testConfirmationCheckboxName(): void
61  {
62  $this->testObj->setConfirmationCheckboxName("testString");
63  $this->assertEquals("testString", $this->testObj->getConfirmationCheckboxName());
64  }
65 
66  public function testConfirmationCheckboxLabel(): void
67  {
68  $this->testObj->setConfirmationCheckboxLabel("testString");
69  $this->assertEquals("testString", $this->testObj->getConfirmationCheckboxLabel());
70  }
71 
72  public function testAddParameter(): void
73  {
74  $this->addGlobal_ilCtrl();
75 
76  $this->addGlobal_lng();
77  $expected = [];
78 
79  foreach ([51, 291, 15, 681] as $id) {
80  $hiddenInput = new ilHiddenInputGUI("postVar" . "_" . $id);
81  $expected[] = $hiddenInput;
82  }
83 
84  foreach ($expected as $hiddenInput) {
85  $this->testObj->addParameter($hiddenInput);
86  }
87 
88  $this->assertEquals($expected, $this->testObj->getParameters());
89  }
90 
91  public function testIsConfirmationCheckboxRequired(): void
92  {
93  $this->assertFalse($this->testObj->isConfirmationCheckboxRequired());
94 
95  $this->testObj->setConfirmationCheckboxName("testName");
96  $this->testObj->setConfirmationCheckboxLabel("testLabel");
97  $this->assertTrue($this->testObj->isConfirmationCheckboxRequired());
98  }
99 }
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilTestPlayerConfirmationModalTest.
Class ilTestBaseClass.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23