ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjTestGUITest Class Reference

Class ilObjTestGUITest. More...

+ Inheritance diagram for ilObjTestGUITest:
+ Collaboration diagram for ilObjTestGUITest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 testTestAccess ()
 
 testRunObject ()
 
 testCancelCreateQuestionObject ()
 
- Public Member Functions inherited from ilTestBaseTestCase
 createInstanceOf (string $class_name, array $explicit_parameters=[])
 
 createTraitInstanceOf (string $class_name, array $explicit_parameters=[])
 

Protected Member Functions

 setUp ()
 
 getNewTestGUI ()
 
- Protected Member Functions inherited from ilTestBaseTestCase
 setUp ()
 
 tearDown ()
 

Private Attributes

ilObjTestGUI $testObj
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTestBaseTestCase
static callMethod ($obj, $name, array $args=[])
 
static getNonPublicPropertyValue (object $obj, string $name)
 
- Data Fields inherited from ilTestBaseTestCase
const string MOCKED_METHOD_WITHOUT_OUTPUT = 'MOCKED_METHOD_WITHOUT_OUTPUT'
 
const string DYNAMIC_CLASS = 'DynamicClass'
 
- Protected Attributes inherited from ilTestBaseTestCase
Container $dic = null
 
Container $backup_dic = null
 
- Static Protected Attributes inherited from ilTestBaseTestCase
static int $DYNAMIC_CLASS_COUNT = 0
 

Detailed Description

Class ilObjTestGUITest.

Author
Marvin Beym mbeym.nosp@m.@dat.nosp@m.abay..nosp@m.de

Definition at line 38 of file ilObjTestGUITest.php.

Member Function Documentation

◆ getNewTestGUI()

ilObjTestGUITest::getNewTestGUI ( )
protected

Definition at line 49 of file ilObjTestGUITest.php.

50 {
51 $table_query = $this->getMockBuilder(QuestionsTableQueryMock::class)->getMock();
52 return new class ($table_query) extends ilObjTestGUI {
53 public function __construct(
54 protected QuestionsTableQuery $mock_table_query
55 ) {
57 }
58 protected function getQuestionsTableQuery(): QuestionsTableQuery
59 {
60 return $this->mock_table_query;
61 }
62 };
63 }
Class ilObjTestGUI.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

Referenced by setUp(), testCancelCreateQuestionObject(), and testRunObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUp()

ilObjTestGUITest::setUp ( )
protected

Reimplemented from ilTestBaseTestCase.

Definition at line 42 of file ilObjTestGUITest.php.

42 : void
43 {
44 parent::setUp();
45
46 $this->testObj = $this->getNewTestGUI();
47 }

References getNewTestGUI().

+ Here is the call graph for this function:

◆ test_instantiateObject_shouldReturnInstance()

ilObjTestGUITest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 65 of file ilObjTestGUITest.php.

65 : void
66 {
67 $this->assertInstanceOf(ilObjTestGUI::class, $this->testObj);
68 }

◆ testCancelCreateQuestionObject()

ilObjTestGUITest::testCancelCreateQuestionObject ( )

Definition at line 91 of file ilObjTestGUITest.php.

91 : void
92 {
93 $ctrl_mock = $this->createMock(ilCtrl::class);
94 $this->setGlobalVariable('ilCtrl', $ctrl_mock);
95 $testObj = $this->getNewTestGUI();
96 $ctrl_mock
97 ->expects($this->once())
98 ->method('redirect')
100 ;
102 }
ilObjTestGUI $testObj
setGlobalVariable(string $name, mixed $value)

References $testObj, ilObjTestGUI\cancelCreateQuestionObject(), getNewTestGUI(), setGlobalVariable(), and ilObjTestGUI\SHOW_QUESTIONS_CMD.

+ Here is the call graph for this function:

◆ testRunObject()

ilObjTestGUITest::testRunObject ( )

Definition at line 78 of file ilObjTestGUITest.php.

78 : void
79 {
80 $ctrl_mock = $this->createMock(ilCtrl::class);
81 $this->setGlobalVariable('ilCtrl', $ctrl_mock);
82 $testObj = $this->getNewTestGUI();
83 $ctrl_mock
84 ->expects($this->once())
85 ->method('redirectByClass')
86 ->with([ilRepositoryGUI::class, ilObjTestGUI::class, ilInfoScreenGUI::class]);
87
89 }

References $testObj, getNewTestGUI(), ilObjTestGUI\runObject(), and setGlobalVariable().

+ Here is the call graph for this function:

◆ testTestAccess()

ilObjTestGUITest::testTestAccess ( )

Definition at line 70 of file ilObjTestGUITest.php.

70 : void
71 {
72 $testAccess_mock = $this->createMock(ilTestAccess::class);
73
74 $this->testObj->setTestAccess($testAccess_mock);
75 $this->assertEquals($testAccess_mock, $this->testObj->getTestAccess());
76 }

Field Documentation

◆ $testObj

ilObjTestGUI ilObjTestGUITest::$testObj
private

Definition at line 40 of file ilObjTestGUITest.php.

Referenced by testCancelCreateQuestionObject(), and testRunObject().


The documentation for this class was generated from the following file: