ILIAS  release_8 Revision v8.24
ilTestPlayerFactoryTest.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 $this->testObj = new ilTestPlayerFactory($this->createMock(ilObjTest::class));
34 }
35
37 {
38 $this->assertInstanceOf(ilTestPlayerFactory::class, $this->testObj);
39 }
40
41 public function testGetPlayerGUI(): void
42 {
43 $this->addGlobal_ilUser();
44 $this->addGlobal_lng();
45 $this->addGlobal_ilias();
46 $this->addGlobal_ilDB();
47 $this->addGlobal_ilLog();
48 $this->addGlobal_ilErr();
49 $this->addGlobal_tree();
52 $this->addGlobal_tpl();
53 $this->addGlobal_ilCtrl();
55 $this->addGlobal_ilTabs();
57 $this->addGlobal_rbacsystem();
58 $this->addGlobal_refinery();
59
60 $objTest = new ilObjTest();
61
62 $objTest->setQuestionSetType(ilObjTest::QUESTION_SET_TYPE_FIXED);
63 $testObj = new ilTestPlayerFactory($objTest);
64 $this->assertInstanceOf(ilTestPlayerFixedQuestionSetGUI::class, $testObj->getPlayerGUI());
65
66 $objTest->setQuestionSetType(ilObjTest::QUESTION_SET_TYPE_RANDOM);
67 $testObj = new ilTestPlayerFactory($objTest);
68 $this->assertInstanceOf(ilTestPlayerRandomQuestionSetGUI::class, $testObj->getPlayerGUI());
69 }
70}
const QUESTION_SET_TYPE_RANDOM
const QUESTION_SET_TYPE_FIXED
Class ilTestBaseClass.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPlayerGUI()
creates and returns an instance of a player gui that corresponds to the current test mode