ILIAS  release_8 Revision v8.23
ilStatisticsTest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilStatisticsTest:
+ Collaboration diagram for ilStatisticsTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 testNANHandling ()
 
 testData ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from ilTestBaseTestCase
 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, $value)
 
 getGlobalTemplateMock ()
 
 getDatabaseMock ()
 
 getIliasMock ()
 
 addGlobal_ilAccess ()
 
 addGlobal_ilUser ()
 
 addGlobal_objDefinition ()
 
 addGlobal_tree ()
 
 addGlobal_ilSetting ()
 
 addGlobal_rbacsystem ()
 
 addGlobal_ilCtrl ()
 
 addGlobal_lng ()
 
 addGlobal_filesystem ()
 
 addGlobal_upload ()
 
 addGlobal_ilDB ()
 
 addGlobal_ilLog ()
 
 addGlobal_ilias ()
 
 addGlobal_ilErr ()
 
 addGlobal_ilAppEventHandler ()
 
 addGlobal_tpl ()
 
 addGlobal_ilComponentRepository ()
 
 addGlobal_ilTabs ()
 
 addGlobal_ilObjDataCache ()
 
 addGlobal_ilLocator ()
 
 addGlobal_rbacreview ()
 
 addGlobal_ilToolbar ()
 
 addGlobal_http ()
 
 addGlobal_ilIliasIniFile ()
 
 addGlobal_ilLoggerFactory ()
 
 addGlobal_ilHelp ()
 
 addGlobal_ui ()
 
 addGlobal_uiFactory ()
 
 addGlobal_uiRenderer ()
 
 addGlobal_refinery ()
 

Private Attributes

ilStatistics $testObj
 

Additional Inherited Members

- Protected Attributes inherited from ilTestBaseTestCase
Container $dic = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilStatisticsTest

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

Definition at line 25 of file ilStatisticsTest.php.

Member Function Documentation

◆ setUp()

ilStatisticsTest::setUp ( )
protected

Definition at line 29 of file ilStatisticsTest.php.

29  : void
30  {
31  parent::setUp();
32 
33  $this->testObj = new ilStatistics();
34  }
This class provides mathematical functions for statistics.

◆ test_instantiateObject_shouldReturnInstance()

ilStatisticsTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 36 of file ilStatisticsTest.php.

36  : void
37  {
38  $this->assertInstanceOf(ilStatistics::class, $this->testObj);
39  }

◆ testData()

ilStatisticsTest::testData ( )

Definition at line 52 of file ilStatisticsTest.php.

References NAN_HANDLING_ZERO.

52  : void
53  {
54  $input = [
55  "1250",
56  "125125",
57  1518,
58  "abasfki",
59  -1251
60  ];
61  $this->testObj->setData($input);
62 
63  $expected1 = [
64  -1251,
65  "1250",
66  1518,
67  "125125",
68  ];
69  $this->assertEquals($expected1, $this->testObj->getData());
70 
71  $expected2 = [
72  -1251,
73  0,
74  "1250",
75  1518,
76  "125125",
77  ];
78  $this->testObj->setNANHandling(NAN_HANDLING_ZERO);
79  $this->testObj->setData($input);
80  $this->assertEquals($expected2, $this->testObj->getData());
81  }
const NAN_HANDLING_ZERO

◆ testNANHandling()

ilStatisticsTest::testNANHandling ( )

Definition at line 41 of file ilStatisticsTest.php.

References NAN_HANDLING_REMOVE, and NAN_HANDLING_ZERO.

41  : void
42  {
43  $this->assertEquals(NAN_HANDLING_REMOVE, $this->testObj->getNANHandling());
44 
45  $this->testObj->setNANHandling(NAN_HANDLING_REMOVE);
46  $this->assertEquals(NAN_HANDLING_REMOVE, $this->testObj->getNANHandling());
47 
48  $this->testObj->setNANHandling(NAN_HANDLING_ZERO);
49  $this->assertEquals(NAN_HANDLING_ZERO, $this->testObj->getNANHandling());
50  }
const NAN_HANDLING_ZERO
const NAN_HANDLING_REMOVE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Field Documentation

◆ $testObj

ilStatistics ilStatisticsTest::$testObj
private

Definition at line 27 of file ilStatisticsTest.php.


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