ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestRandomQuestionSetSourcePoolDefinitionListTest 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 ilTestRandomQuestionSetSourcePoolDefinitionListTest:
+ Collaboration diagram for ilTestRandomQuestionSetSourcePoolDefinitionListTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 testAddDefinition ()
 
 testSetTrashedPools ()
 
 testIsTrashedPool ()
 
 testHasTrashedPool ()
 
 testHasDefinition ()
 
 testGetDefinition ()
 
 testGetDefinitionBySourcePoolId ()
 
 testGetDefinitionIds ()
 
 testGetDefinitionCount ()
 

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

ilTestRandomQuestionSetSourcePoolDefinitionList $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 ilTestRandomQuestionSetSourcePoolDefinitionListTest

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

Definition at line 25 of file ilTestRandomQuestionSetSourcePoolDefinitionListTest.php.

Member Function Documentation

◆ setUp()

ilTestRandomQuestionSetSourcePoolDefinitionListTest::setUp ( )
protected

Definition at line 29 of file ilTestRandomQuestionSetSourcePoolDefinitionListTest.php.

29  : void
30  {
31  parent::setUp();
32 
34  $this->createMock(ilDBInterface::class),
35  $this->createMock(ilObjTest::class),
36  $this->createMock(ilTestRandomQuestionSetSourcePoolDefinitionFactory::class)
37  );
38  }

◆ test_instantiateObject_shouldReturnInstance()

ilTestRandomQuestionSetSourcePoolDefinitionListTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 40 of file ilTestRandomQuestionSetSourcePoolDefinitionListTest.php.

40  : void
41  {
42  $this->assertInstanceOf(ilTestRandomQuestionSetSourcePoolDefinitionList::class, $this->testObj);
43  }

◆ testAddDefinition()

ilTestRandomQuestionSetSourcePoolDefinitionListTest::testAddDefinition ( )

Definition at line 45 of file ilTestRandomQuestionSetSourcePoolDefinitionListTest.php.

45  : void
46  {
48  $this->createMock(ilDBInterface::class),
49  $this->createMock(ilObjTest::class)
50  );
51  $expected->setId(20);
52  $this->testObj->addDefinition($expected);
53 
54  $this->assertEquals($expected, $this->testObj->getDefinition(20));
55  }

◆ testGetDefinition()

ilTestRandomQuestionSetSourcePoolDefinitionListTest::testGetDefinition ( )

Definition at line 97 of file ilTestRandomQuestionSetSourcePoolDefinitionListTest.php.

97  : void
98  {
100  $this->createMock(ilDBInterface::class),
101  $this->createMock(ilObjTest::class)
102  );
103  $expected->setId(20);
104  $this->testObj->addDefinition($expected);
105 
106  $this->assertEquals($expected, $this->testObj->getDefinition(20));
107  }

◆ testGetDefinitionBySourcePoolId()

ilTestRandomQuestionSetSourcePoolDefinitionListTest::testGetDefinitionBySourcePoolId ( )

Definition at line 109 of file ilTestRandomQuestionSetSourcePoolDefinitionListTest.php.

109  : void
110  {
112  $this->createMock(ilDBInterface::class),
113  $this->createMock(ilObjTest::class)
114  );
115  $expected->setId(20);
116  $expected->setPoolId(11);
117  $this->testObj->addDefinition($expected);
118 
119  $this->assertEquals($expected, $this->testObj->getDefinitionBySourcePoolId(11));
120  }

◆ testGetDefinitionCount()

ilTestRandomQuestionSetSourcePoolDefinitionListTest::testGetDefinitionCount ( )

Definition at line 135 of file ilTestRandomQuestionSetSourcePoolDefinitionListTest.php.

135  : void
136  {
138  $this->createMock(ilDBInterface::class),
139  $this->createMock(ilObjTest::class)
140  );
141  $expected->setId(20);
142  $expected->setPoolId(11);
143  $this->testObj->addDefinition($expected);
144 
145  $this->assertEquals(1, $this->testObj->getDefinitionCount());
146  }

◆ testGetDefinitionIds()

ilTestRandomQuestionSetSourcePoolDefinitionListTest::testGetDefinitionIds ( )

Definition at line 122 of file ilTestRandomQuestionSetSourcePoolDefinitionListTest.php.

122  : void
123  {
125  $this->createMock(ilDBInterface::class),
126  $this->createMock(ilObjTest::class)
127  );
128  $expected->setId(20);
129  $expected->setPoolId(11);
130  $this->testObj->addDefinition($expected);
131 
132  $this->assertEquals([20], $this->testObj->getDefinitionIds());
133  }

◆ testHasDefinition()

ilTestRandomQuestionSetSourcePoolDefinitionListTest::testHasDefinition ( )

Definition at line 85 of file ilTestRandomQuestionSetSourcePoolDefinitionListTest.php.

85  : void
86  {
88  $this->createMock(ilDBInterface::class),
89  $this->createMock(ilObjTest::class)
90  );
91  $expected->setId(20);
92  $this->testObj->addDefinition($expected);
93 
94  $this->assertTrue($this->testObj->hasDefinition(20));
95  }

◆ testHasTrashedPool()

ilTestRandomQuestionSetSourcePoolDefinitionListTest::testHasTrashedPool ( )

Definition at line 76 of file ilTestRandomQuestionSetSourcePoolDefinitionListTest.php.

76  : void
77  {
78  $poolIds = [12, 22, 16];
79 
80  $this->testObj->setTrashedPools($poolIds);
81 
82  $this->assertTrue($this->testObj->hasTrashedPool());
83  }

◆ testIsTrashedPool()

ilTestRandomQuestionSetSourcePoolDefinitionListTest::testIsTrashedPool ( )

Definition at line 66 of file ilTestRandomQuestionSetSourcePoolDefinitionListTest.php.

66  : void
67  {
68  $poolIds = [12, 22, 16];
69 
70  $this->testObj->setTrashedPools($poolIds);
71 
72  $this->assertTrue($this->testObj->isTrashedPool(0));
73  $this->assertFalse($this->testObj->isTrashedPool(4));
74  }

◆ testSetTrashedPools()

ilTestRandomQuestionSetSourcePoolDefinitionListTest::testSetTrashedPools ( )

Definition at line 57 of file ilTestRandomQuestionSetSourcePoolDefinitionListTest.php.

57  : void
58  {
59  $poolIds = [12, 22, 16];
60 
61  $this->testObj->setTrashedPools($poolIds);
62 
63  $this->assertEquals($poolIds, $this->testObj->getTrashedPools());
64  }

Field Documentation

◆ $testObj

ilTestRandomQuestionSetSourcePoolDefinitionList ilTestRandomQuestionSetSourcePoolDefinitionListTest::$testObj
private

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