Unit tests for assErrorTextTest.
More...
◆ setUp()
assErrorTextTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 15 of file assErrorTextTest.php.
References assBaseTestCase\getDatabaseMock(), assBaseTestCase\getGlobalTemplateMock(), assBaseTestCase\getIliasMock(), and assBaseTestCase\setGlobalVariable().
17 if (defined(
'ILIAS_PHPUNIT_CONTEXT')) {
18 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
19 ilUnitUtil::performInitialisation();
21 chdir(dirname(__FILE__));
26 require_once
'./Services/UICore/classes/class.ilCtrl.php';
27 $ilCtrl_mock = $this->createMock(
'ilCtrl');
28 $ilCtrl_mock->expects($this->any())->method(
'saveParameter');
29 $ilCtrl_mock->expects($this->any())->method(
'saveParameterByClass');
32 require_once
'./Services/Language/classes/class.ilLanguage.php';
33 $lng_mock = $this->createMock(
'ilLanguage', array(
'txt'), array(),
'',
false);
setGlobalVariable($name, $value)
◆ test_getErrorsFromText()
assErrorTextTest::test_getErrorsFromText |
( |
| ) |
|
Definition at line 55 of file assErrorTextTest.php.
58 require_once
'./Modules/TestQuestionPool/classes/class.assErrorText.php';
62 Eine ((Kündigung)) kommt durch zwei gleichlautende Willenserklärungen zustande. 63 Ein Vertrag kommt durch ((drei gleichlaute)) Willenserklärungen zustande. 64 Ein Kaufvertrag an der Kasse im #Supermarkt kommt durch das legen von Ware auf das 65 Kassierband und den Kassiervorgang zustande. Dies nennt man ((konsequentes)) Handeln.';
68 'passages' => array( 0 =>
'Kündigung', 1 =>
'drei gleichlaute', 3 =>
'konsequentes'),
69 'words' => array( 2 =>
'Supermarkt')
73 $actual = $instance->getErrorsFromText($errortext);
76 $this->assertEquals($expected, $actual);
Class for error text questions.
◆ test_getErrorsFromText_emptyArgShouldPullInternal()
assErrorTextTest::test_getErrorsFromText_emptyArgShouldPullInternal |
( |
| ) |
|
Definition at line 100 of file assErrorTextTest.php.
103 require_once
'./Modules/TestQuestionPool/classes/class.assErrorText.php';
107 Eine ((Kündigung)) kommt durch zwei gleichlautende Willenserklärungen zustande. 108 Ein Vertrag kommt durch ((drei gleichlaute)) Willenserklärungen zustande. 109 Ein Kaufvertrag an der Kasse im #Supermarkt kommt durch das legen von Ware auf das 110 Kassierband und den Kassiervorgang zustande. Dies nennt man ((konsequentes)) Handeln.';
113 'passages' => array( 0 =>
'Kündigung', 1 =>
'drei gleichlaute', 3 =>
'konsequentes'),
114 'words' => array( 2 =>
'Supermarkt')
118 $instance->setErrorText($errortext);
119 $actual = $instance->getErrorsFromText(
'');
122 $this->assertEquals($expected, $actual);
Class for error text questions.
◆ test_getErrorsFromText_noMatch()
assErrorTextTest::test_getErrorsFromText_noMatch |
( |
| ) |
|
Definition at line 79 of file assErrorTextTest.php.
82 require_once
'./Modules/TestQuestionPool/classes/class.assErrorText.php';
86 Eine Kündigung)) kommt durch zwei gleichlautende (Willenserklärungen) zustande. 87 Ein Vertrag kommt durch (drei gleichlaute) Willenserklärungen zustande. 88 Ein Kaufvertrag an der Kasse im Supermarkt [kommt] durch das legen von Ware auf das 89 Kassierband und den [[Kassiervorgang]] zustande. Dies nennt man *konsequentes Handeln.';
94 $actual = $instance->getErrorsFromText($errortext);
97 $this->assertEquals($expected, $actual);
Class for error text questions.
◆ test_instantiateObjectSimple()
assErrorTextTest::test_instantiateObjectSimple |
( |
| ) |
|
Definition at line 43 of file assErrorTextTest.php.
46 require_once
'./Modules/TestQuestionPool/classes/class.assErrorText.php';
52 $this->assertInstanceOf(
'assErrorText', $instance);
Class for error text questions.
◆ test_setErrordata_newError()
assErrorTextTest::test_setErrordata_newError |
( |
| ) |
|
Definition at line 125 of file assErrorTextTest.php.
128 require_once
'./Modules/TestQuestionPool/classes/class.assErrorText.php';
131 $errordata = array(
'passages' => array( 0 =>
'drei Matrosen'),
'words' => array());
132 require_once
"./Modules/TestQuestionPool/classes/class.assAnswerErrorText.php";
136 $instance->setErrorData($errordata);
138 $all_errors = $instance->getErrorData();
139 $actual = $all_errors[0];
142 $this->assertEquals($expected, $actual);
Class for error text answers.
Class for error text questions.
◆ test_setErrordata_oldErrordataPresent()
assErrorTextTest::test_setErrordata_oldErrordataPresent |
( |
| ) |
|
Definition at line 145 of file assErrorTextTest.php.
148 require_once
'./Modules/TestQuestionPool/classes/class.assErrorText.php';
151 $errordata = array(
'passages' => array( 0 =>
'drei Matrosen'),
'words' => array());
152 require_once
"./Modules/TestQuestionPool/classes/class.assAnswerErrorText.php";
154 $instance->errordata = $expected;
157 $instance->setErrorData($errordata);
159 $all_errors = $instance->getErrorData();
160 $actual = $all_errors[0];
163 $this->assertEquals($expected, $actual);
Class for error text answers.
Class for error text questions.
◆ $backupGlobals
assErrorTextTest::$backupGlobals = false |
|
protected |
The documentation for this class was generated from the following file: