ILIAS  release_8 Revision v8.24
ilTestSkillEvaluationToolbarGUITest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
26{
28
29 protected function setUp(): void
30 {
31 parent::setUp();
32
33 $ctrl_mock = $this->createMock(ilCtrl::class);
34 $lng_mock = $this->createMock(ilLanguage::class);
35 $this->setGlobalVariable("lng", $lng_mock);
36
37 $parentGui_mock = $this->createMock(ilTestSkillEvaluationGUI::class);
38 $this->toolbarGUI = new ilTestSkillEvaluationToolbarGUI(
39 $ctrl_mock,
40 $lng_mock,
41 $parentGui_mock,
43 );
44 }
45
47 {
48 $this->assertInstanceOf(ilTestSkillEvaluationToolbarGUI::class, $this->toolbarGUI);
49 }
50
51 public function testAvailableSkillProfiles(): void
52 {
53 $expected = ["test1", "test2", "test3"];
54
55 $this->toolbarGUI->setAvailableSkillProfiles($expected);
56
57 $this->assertEquals($expected, $this->toolbarGUI->getAvailableSkillProfiles());
58 }
59
60 public function testNoSkillProfileOptionEnabled(): void
61 {
62 $this->toolbarGUI->setNoSkillProfileOptionEnabled(true);
63 $this->assertTrue($this->toolbarGUI->isNoSkillProfileOptionEnabled());
64
65 $this->toolbarGUI->setNoSkillProfileOptionEnabled(false);
66 $this->assertFalse($this->toolbarGUI->isNoSkillProfileOptionEnabled());
67 }
68
69 public function testSelectedEvaluationMode(): void
70 {
71 $this->toolbarGUI->setSelectedEvaluationMode("testString");
72 $this->assertEquals("testString", $this->toolbarGUI->getSelectedEvaluationMode());
73 }
74
75 public function testFetchSkillProfileParam(): void
76 {
79 );
80
81 $this->assertEquals(102, $result);
82
84 ["randomKey" => "102"]
85 );
86
87 $this->assertEquals(0, $result);
88 }
89}
Class ilTestBaseClass.
setGlobalVariable(string $name, $value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...