ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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.

References QuestionsTableQueryMock\__construct(), and ILIAS\GlobalScreen\Provider\__construct().

49  : ilObjTestGUI
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  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

◆ setUp()

ilObjTestGUITest::setUp ( )
protected

Definition at line 42 of file ilObjTestGUITest.php.

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

◆ 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.

References ilObjTestGUI\cancelCreateQuestionObject(), setGlobalVariable(), and ilObjTestGUI\SHOW_QUESTIONS_CMD.

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  }
setGlobalVariable(string $name, mixed $value)
ilObjTestGUI $testObj
+ Here is the call graph for this function:

◆ testRunObject()

ilObjTestGUITest::testRunObject ( )

Definition at line 78 of file ilObjTestGUITest.php.

References ilObjTestGUI\runObject(), and setGlobalVariable().

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  }
setGlobalVariable(string $name, mixed $value)
ilObjTestGUI $testObj
+ 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.


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