Unit tests for assErrorTextTest.
More...
◆ setUp()
assErrorTextTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 15 of file assErrorTextTest.php.
References $ilCtrl, $lng, array, and defined.
17 if (
defined(
'ILIAS_PHPUNIT_CONTEXT')) {
18 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
19 ilUnitUtil::performInitialisation();
21 chdir(dirname(__FILE__));
24 require_once
'./Services/UICore/classes/class.ilCtrl.php';
25 $ilCtrl_mock = $this->createMock(
'ilCtrl');
26 $ilCtrl_mock->expects($this->any())->method(
'saveParameter');
27 $ilCtrl_mock->expects($this->any())->method(
'saveParameterByClass');
29 $ilCtrl = $ilCtrl_mock;
31 require_once
'./Services/Language/classes/class.ilLanguage.php';
32 $lng_mock = $this->createMock(
'ilLanguage',
array(
'txt'),
array(),
'',
false);
37 $ilias_mock =
new stdClass();
38 $ilias_mock->account =
new stdClass();
39 $ilias_mock->account->id = 6;
40 $ilias_mock->account->fullname =
'Esther Tester';
Create styles array
The data for the language used.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
◆ test_getErrorsFromText()
assErrorTextTest::test_getErrorsFromText |
( |
| ) |
|
Definition at line 58 of file assErrorTextTest.php.
References array.
61 require_once
'./Modules/TestQuestionPool/classes/class.assErrorText.php';
65 Eine ((Kündigung)) kommt durch zwei gleichlautende Willenserklärungen zustande. 66 Ein Vertrag kommt durch ((drei gleichlaute)) Willenserklärungen zustande. 67 Ein Kaufvertrag an der Kasse im #Supermarkt kommt durch das legen von Ware auf das 68 Kassierband und den Kassiervorgang zustande. Dies nennt man ((konsequentes)) Handeln.';
71 'passages' =>
array( 0 =>
'Kündigung', 1=>
'drei gleichlaute', 3 =>
'konsequentes'),
72 'words' =>
array( 2 =>
'Supermarkt')
76 $actual = $instance->getErrorsFromText($errortext);
79 $this->assertEquals($expected, $actual);
Class for error text questions.
Create styles array
The data for the language used.
◆ test_getErrorsFromText_emptyArgShouldPullInternal()
assErrorTextTest::test_getErrorsFromText_emptyArgShouldPullInternal |
( |
| ) |
|
Definition at line 103 of file assErrorTextTest.php.
References array.
106 require_once
'./Modules/TestQuestionPool/classes/class.assErrorText.php';
110 Eine ((Kündigung)) kommt durch zwei gleichlautende Willenserklärungen zustande. 111 Ein Vertrag kommt durch ((drei gleichlaute)) Willenserklärungen zustande. 112 Ein Kaufvertrag an der Kasse im #Supermarkt kommt durch das legen von Ware auf das 113 Kassierband und den Kassiervorgang zustande. Dies nennt man ((konsequentes)) Handeln.';
116 'passages' =>
array( 0 =>
'Kündigung', 1=>
'drei gleichlaute', 3 =>
'konsequentes'),
117 'words' =>
array( 2 =>
'Supermarkt')
121 $instance->setErrorText($errortext);
122 $actual = $instance->getErrorsFromText(
'');
125 $this->assertEquals($expected, $actual);
Class for error text questions.
Create styles array
The data for the language used.
◆ test_getErrorsFromText_noMatch()
assErrorTextTest::test_getErrorsFromText_noMatch |
( |
| ) |
|
Definition at line 82 of file assErrorTextTest.php.
References array.
85 require_once
'./Modules/TestQuestionPool/classes/class.assErrorText.php';
89 Eine Kündigung)) kommt durch zwei gleichlautende (Willenserklärungen) zustande. 90 Ein Vertrag kommt durch (drei gleichlaute) Willenserklärungen zustande. 91 Ein Kaufvertrag an der Kasse im Supermarkt [kommt] durch das legen von Ware auf das 92 Kassierband und den [[Kassiervorgang]] zustande. Dies nennt man *konsequentes Handeln.';
97 $actual = $instance->getErrorsFromText($errortext);
100 $this->assertEquals($expected, $actual);
Class for error text questions.
Create styles array
The data for the language used.
◆ test_instantiateObjectSimple()
assErrorTextTest::test_instantiateObjectSimple |
( |
| ) |
|
Definition at line 46 of file assErrorTextTest.php.
49 require_once
'./Modules/TestQuestionPool/classes/class.assErrorText.php';
55 $this->assertInstanceOf(
'assErrorText', $instance);
Class for error text questions.
◆ test_setErrordata_newError()
assErrorTextTest::test_setErrordata_newError |
( |
| ) |
|
Definition at line 128 of file assErrorTextTest.php.
References array.
131 require_once
'./Modules/TestQuestionPool/classes/class.assErrorText.php';
134 $errordata =
array(
'passages' =>
array( 0 =>
'drei Matrosen'),
'words' =>
array());
135 require_once
"./Modules/TestQuestionPool/classes/class.assAnswerErrorText.php";
139 $instance->setErrorData($errordata);
141 $all_errors = $instance->getErrorData();
142 $actual = $all_errors[0];
145 $this->assertEquals($expected, $actual);
Class for error text answers.
Class for error text questions.
Create styles array
The data for the language used.
◆ test_setErrordata_oldErrordataPresent()
assErrorTextTest::test_setErrordata_oldErrordataPresent |
( |
| ) |
|
Definition at line 148 of file assErrorTextTest.php.
References array.
151 require_once
'./Modules/TestQuestionPool/classes/class.assErrorText.php';
154 $errordata =
array(
'passages' =>
array( 0 =>
'drei Matrosen'),
'words' =>
array());
155 require_once
"./Modules/TestQuestionPool/classes/class.assAnswerErrorText.php";
157 $instance->errordata = $expected;
160 $instance->setErrorData($errordata);
162 $all_errors = $instance->getErrorData();
163 $actual = $all_errors[0];
166 $this->assertEquals($expected, $actual);
Class for error text answers.
Class for error text questions.
Create styles array
The data for the language used.
◆ $backupGlobals
assErrorTextTest::$backupGlobals = false |
|
protected |
The documentation for this class was generated from the following file: