This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
More...
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 ilAssQuestionSkillAssignmentRegistryTest
Definition at line 22 of file ilAssQuestionSkillAssignmentRegistryTest.php.
◆ getTestData()
static ilAssQuestionSkillAssignmentRegistryTest::getTestData |
( |
callable |
$pre, |
|
|
callable |
$post |
|
) |
| |
|
staticprotected |
- Parameters
-
callable | $pre | |
callable | $post | |
- Returns
- array
Definition at line 109 of file ilAssQuestionSkillAssignmentRegistryTest.php.
References $data, $post, and ilAssQuestionSkillAssignment\EVAL_MODE_BY_QUESTION_SOLUTION.
115 for ($i = 0; $i < 5; $i++) {
118 $assignment->setImportSkillTitle(
'phpunit' . $i);
119 $assignment->setImportSkillPath(
'phpunit' . $i);
120 $random = new \Random\Randomizer();
121 $assignment->setSkillPoints($random->getInt(0, PHP_INT_MAX));
122 $assignment->setImportQuestionId($random->getInt(0, PHP_INT_MAX));
123 $assignment->setImportSkillBaseId($random->getInt(0, PHP_INT_MAX));
124 $assignment->setImportSkillTrefId($random->getInt(0, PHP_INT_MAX));
126 $assignmentList->addAssignment($assignment);
130 [
'This is a Test', 2],
132 [
'This is a Test with a huge chunk size', 10000],
133 [$assignmentList, 7],
136 foreach ($rawData as $rawItem) {
137 $data[] = [$rawItem[0], $rawItem[1], $pre,
$post];
const EVAL_MODE_BY_QUESTION_SOLUTION
◆ serializedData()
static ilAssQuestionSkillAssignmentRegistryTest::serializedData |
( |
| ) |
|
|
static |
◆ setUp()
ilAssQuestionSkillAssignmentRegistryTest::setUp |
( |
| ) |
|
◆ testInvalidChunkSizeWillRaiseException()
ilAssQuestionSkillAssignmentRegistryTest::testInvalidChunkSizeWillRaiseException |
( |
| ) |
|
Definition at line 85 of file ilAssQuestionSkillAssignmentRegistryTest.php.
References Vendor\Package\$e.
87 $settingsMock = $this->getMockBuilder(
'ilSetting')->disableOriginalConstructor()->onlyMethods([
'set',
'get',
'delete'])->getMock();
91 $registry->setChunkSize(
'a');
92 $this->fail(
'Failed asserting that exception of type "InvalidArgumentException" is thrown.');
98 $registry->setChunkSize(-5);
99 $this->fail(
'Failed asserting that exception of type "InvalidArgumentException" is thrown.');
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ testSkillAssignmentsCanBetStoredAndFetchedBySerializationStrategy()
ilAssQuestionSkillAssignmentRegistryTest::testSkillAssignmentsCanBetStoredAndFetchedBySerializationStrategy |
( |
|
$value, |
|
|
|
$chunkSize, |
|
|
callable |
$preCallback, |
|
|
callable |
$postCallback |
|
) |
| |
serializedData
- Parameters
-
| $value | |
| $chunkSize | |
callable | $preCallback | |
callable | $postCallback | |
Definition at line 45 of file ilAssQuestionSkillAssignmentRegistryTest.php.
47 $this->markTestSkipped(
'Data Provider needs to be revisited.');
49 $settingsMock = $this->getMockBuilder(
'ilSetting')->disableOriginalConstructor()->onlyMethods([
'set',
'get',
'delete'])->getMock();
51 $settingsMock->expects($this->any())->method(
'set')->will(
52 $this->returnCallback(
function ($key, $value) {
53 $this->storage[$key] = $value;
57 $settingsMock->expects($this->any())->method(
'get')->will(
58 $this->returnCallback(
function ($key, $value) {
59 return $this->storage[$key] ?? $value;
63 $settingsMock->expects($this->any())->method(
'delete')->will(
64 $this->returnCallback(
function ($key, $value) {
65 if (isset($this->storage[$key])) {
66 unset($this->storage[$key]);
71 $valueToTest = $preCallback($value);
74 $registry->setChunkSize($chunkSize);
75 $registry->setStringifiedImports(self::TEST_KEY, $valueToTest);
76 $actual = $registry->getStringifiedImports(self::TEST_KEY);
78 $this->assertEquals($valueToTest, $actual);
79 $this->assertEquals($value, $postCallback($actual));
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ $storage
array ilAssQuestionSkillAssignmentRegistryTest::$storage = [] |
|
protected |
◆ TEST_KEY
const ilAssQuestionSkillAssignmentRegistryTest::TEST_KEY = 'phpunit_tst' |
The documentation for this class was generated from the following file: