ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestPersonalDefaultSettingsTableGUITest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
29 
30  protected function setUp(): void
31  {
32  parent::setUp();
33 
34  $lng_mock = $this->createMock(ilLanguage::class);
35  $ctrl_mock = $this->createMock(ilCtrl::class);
36  $ctrl_mock->expects($this->any())
37  ->method("getFormAction")
38  ->willReturnCallback(function () {
39  return "testFormAction";
40  });
41 
42  $this->setGlobalVariable("lng", $lng_mock);
43  $this->setGlobalVariable("ilCtrl", $ctrl_mock);
44  $this->setGlobalVariable("tpl", $this->createMock(ilGlobalPageTemplate::class));
45  $this->setGlobalVariable("component.repository", $this->createMock(ilComponentRepository::class));
46  $component_factory = $this->createMock(ilComponentFactory::class);
47  $component_factory->method("getActivePluginsInSlot")->willReturn(new ArrayIterator());
48  $this->setGlobalVariable("component.factory", $component_factory);
49  $this->setGlobalVariable("ilDB", $this->createMock(ilDBInterface::class));
50 
51  $this->parentObj_mock = $this->getMockBuilder(ilObjTestGUI::class)->disableOriginalConstructor()->onlyMethods(['getObject'])->getMock();
52  $this->parentObj_mock->expects($this->any())->method('getObject')->willReturn($this->getTestObjMock());
53  $this->tableGui = new ilTestPersonalDefaultSettingsTableGUI($this->parentObj_mock, "");
54  }
55 
57  {
58  $this->assertInstanceOf(ilTestPersonalDefaultSettingsTableGUI::class, $this->tableGui);
59  }
60 
61  public function testNumericOrdering(): void
62  {
63  $this->assertTrue($this->tableGui->numericOrdering("tstamp"));
64  $this->assertFalse($this->tableGui->numericOrdering("randomString"));
65  }
66 }
Class ilTestPersonalDefaultSettingsTableGUITest.