ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestRandomQuestionSetSourcePoolDefinitionFactoryTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
28 
29  protected function setUp(): void
30  {
31  parent::setUp();
32 
34  $this->createMock(ilDBInterface::class),
35  $this->getTestObjMock()
36  );
37  }
38 
40  {
41  $this->assertInstanceOf(ilTestRandomQuestionSetSourcePoolDefinitionFactory::class, $this->testObj);
42  }
43 
45  {
46  $originalPoolData = [
47  "qpl_id" => 2,
48  'qpl_ref_id' => 4711,
49  "qpl_title" => "testTitle",
50  "qpl_path" => "test/path",
51  "count" => 5
52  ];
53 
54  $result = $this->testObj->getSourcePoolDefinitionByOriginalPoolData($originalPoolData);
55  $this->assertEquals($originalPoolData["qpl_id"], $result->getPoolId());
56  $this->assertEquals($originalPoolData["qpl_ref_id"], $result->getPoolRefId());
57  $this->assertEquals($originalPoolData["qpl_title"], $result->getPoolTitle());
58  $this->assertEquals($originalPoolData["qpl_path"], $result->getPoolPath());
59  $this->assertEquals($originalPoolData["count"], $result->getPoolQuestionCount());
60  }
61 
62  public function testGetEmptySourcePoolDefinition(): void
63  {
64  $this->assertInstanceOf(
65  ilTestRandomQuestionSetSourcePoolDefinition::class,
66  $this->testObj->getEmptySourcePoolDefinition()
67  );
68  }
69 }