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 Unit tests for assErrorTextTest
- Author
- Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
\
Definition at line 26 of file assErrorTextTest.php.
◆ setUp()
assErrorTextTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 30 of file assErrorTextTest.php.
References getDatabaseMock(), getIliasMock(), and setGlobalVariable().
32 chdir(__DIR__ .
'/../../../../');
36 $ilCtrl_mock = $this->createMock(
'ilCtrl');
37 $ilCtrl_mock->expects($this->any())->method(
'saveParameter');
38 $ilCtrl_mock->expects($this->any())->method(
'saveParameterByClass');
41 $lng_mock = $this->createMock(
'ilLanguage', [
'txt'], [],
'',
false);
setGlobalVariable(string $name, mixed $value)
◆ test_getErrorsFromText()
assErrorTextTest::test_getErrorsFromText |
( |
| ) |
|
Definition at line 55 of file assErrorTextTest.php.
57 $this->markTestSkipped(
'Generates warning for some unknown reason.');
60 $instance->setPointsWrong(-2);
63 Eine Kündigung kommt durch zwei ((gleichlautende Willenserklärungen zustande)). 64 Ein Vertrag kommt durch ((drei gleichlaute)) Willenserklärungen zustande. 65 Ein Kaufvertrag an der Kasse im #Supermarkt kommt durch das legen von Ware auf das 66 Kassierband und den Kassiervorgang zustande. Dies nennt man ((konsequentes Handeln.))';
75 $instance->setErrorText($errortext);
76 $instance->parseErrorText();
77 $instance->setErrorsFromParsedErrorText();
78 $actual = $instance->getErrorData();
80 $this->assertEquals($expected, $actual);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class for error text questions.
◆ test_getErrorsFromText_noMatch()
assErrorTextTest::test_getErrorsFromText_noMatch |
( |
| ) |
|
Definition at line 83 of file assErrorTextTest.php.
85 $this->markTestSkipped(
'Generates warning for some unknown reason.');
88 $instance->setPointsWrong(-2);
91 Eine Kündigung)) kommt durch zwei gleichlautende (Willenserklärungen) zustande. 92 Ein Vertrag kommt durch (drei gleichlaute) Willenserklärungen zustande. 93 Ein Kaufvertrag an der Kasse im Supermarkt [kommt] durch das legen von Ware auf das 94 Kassierband und den [[Kassiervorgang]] zustande. Dies nennt man *konsequentes Handeln.';
98 $instance->setErrorText($errortext);
99 $instance->parseErrorText();
100 $instance->setErrorsFromParsedErrorText();
101 $actual = $instance->getErrorData();
103 $this->assertEquals($expected, $actual);
Class for error text questions.
◆ test_instantiateObjectSimple()
assErrorTextTest::test_instantiateObjectSimple |
( |
| ) |
|
Definition at line 48 of file assErrorTextTest.php.
52 $this->assertInstanceOf(assErrorText::class, $instance);
Class for error text questions.
◆ test_removeErrorDataWithoutPosition()
assErrorTextTest::test_removeErrorDataWithoutPosition |
( |
| ) |
|
Definition at line 144 of file assErrorTextTest.php.
147 $instance->setPointsWrong(-2);
149 $parsed_errortext = [
151 [
'text' =>
'1',
'error_type' =>
'none'],
153 'text' =>
'gleichlautende',
154 'text_wrong' =>
'gleichlautende Willenserklärungen zustande.',
155 'error_type' =>
'passage_start',
156 'error_position' => 1,
157 'text_correct' =>
'',
160 [
'text' =>
'2',
'error_type' =>
'none'],
162 'text' =>
'Supermarkt',
163 'text_wrong' =>
'Supermarkt',
164 'error_type' =>
'word',
165 'error_position' => 3,
166 'text_correct' =>
'',
183 $instance->setParsedErrorText($parsed_errortext);
184 $instance->setErrorData($errordata);
185 $instance->removeErrorDataWithoutPosition();
186 $actual = $instance->getErrorData();
188 $this->assertEquals($expected, $actual);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class for error text questions.
◆ test_setErrordata()
assErrorTextTest::test_setErrordata |
( |
| ) |
|
Definition at line 106 of file assErrorTextTest.php.
References null.
109 $instance->setPointsWrong(-2);
113 $instance->setErrorData($errordata);
114 $actual = $instance->getErrorData();
116 $this->assertEquals($expected, $actual);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class for error text questions.
◆ test_setErrordata_oldErrordataPresent()
assErrorTextTest::test_setErrordata_oldErrordataPresent |
( |
| ) |
|
Definition at line 119 of file assErrorTextTest.php.
122 $instance->setPointsWrong(-2);
137 $instance->setErrorData($old_errordata);
138 $instance->setErrorData($new_errordata);
140 $actual = $instance->getErrorData();
142 $this->assertEquals($new_errordata, $actual);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class for error text questions.
◆ $backupGlobals
assErrorTextTest::$backupGlobals = false |
|
protected |
The documentation for this class was generated from the following file: