19 declare(strict_types=1);
29 protected function setUp(): void
34 $this->createMock(ilDBInterface::class),
35 $this->getTestObjMock(),
36 $this->createMock(ilTestRandomQuestionSetSourcePoolDefinitionFactory::class)
42 $this->assertInstanceOf(ilTestRandomQuestionSetSourcePoolDefinitionList::class, $this->testObj);
49 $this->createMock(ilDBInterface::class),
50 $this->getTestObjMock()
52 $expected->setId(
$id);
53 $this->testObj->addDefinition($expected);
55 $this->assertEquals($expected, $this->testObj->getDefinition(
$id));
60 $poolIds = [12, 22, 16];
62 $this->testObj->setTrashedPools($poolIds);
64 $this->assertEquals($poolIds, $this->testObj->getTrashedPools());
69 $poolIds = [12, 22, 16];
71 $this->testObj->setTrashedPools($poolIds);
73 $this->assertTrue($this->testObj->isTrashedPool(0));
74 $this->assertFalse($this->testObj->isTrashedPool(4));
79 $poolIds = [12, 22, 16];
81 $this->testObj->setTrashedPools($poolIds);
83 $this->assertTrue($this->testObj->hasTrashedPool());
89 $this->createMock(ilDBInterface::class),
90 $this->getTestObjMock()
93 $expected->setId(
$id);
94 $this->testObj->addDefinition($expected);
96 $this->assertTrue($this->testObj->hasDefinition(
$id));
102 $this->createMock(ilDBInterface::class),
103 $this->getTestObjMock()
106 $expected->setId(
$id);
107 $this->testObj->addDefinition($expected);
109 $this->assertEquals($expected, $this->testObj->getDefinition(
$id));
115 $this->createMock(ilDBInterface::class),
116 $this->getTestObjMock()
120 $expected->setId(
$id);
121 $expected->setPoolId($poolId);
122 $this->testObj->addDefinition($expected);
124 $this->assertEquals($expected, $this->testObj->getDefinitionBySourcePoolId($poolId));
130 $this->createMock(ilDBInterface::class),
131 $this->getTestObjMock()
135 $expected->setId(
$id);
136 $expected->setPoolId($poolId);
137 $this->testObj->addDefinition($expected);
139 $this->assertEquals([
$id], $this->testObj->getDefinitionIds());
145 $this->createMock(ilDBInterface::class),
146 $this->getTestObjMock()
148 $expected->setId(20);
149 $expected->setPoolId(11);
150 $this->testObj->addDefinition($expected);
152 $this->assertEquals(1, $this->testObj->getDefinitionCount());
test_instantiateObject_shouldReturnInstance()
Class ilTestRandomQuestionSetSourcePoolDefinitionListTest.
testGetDefinitionBySourcePoolId()
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
ilTestRandomQuestionSetSourcePoolDefinitionList $testObj