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
- Author
 - Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
 
\ 
Definition at line 26 of file assClozeTestTest.php.
 
◆ setUp()
  
  
      
        
          | assClozeTestTest::setUp  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Definition at line 30 of file assClozeTestTest.php.
   34         $ilCtrl_mock = $this->getMockBuilder(ilCtrl::class)
    35                             ->disableOriginalConstructor()
    37         $ilCtrl_mock->method(
'saveParameter');
    38         $ilCtrl_mock->method(
'saveParameterByClass');
    39         $this->setGlobalVariable(
'ilCtrl', $ilCtrl_mock);
    41         $lng_mock = $this->getMockBuilder(ilLanguage::class)
    42                          ->disableOriginalConstructor()
    43                          ->onlyMethods([
'txt'])
    45         $lng_mock->method(
'txt')->will($this->returnValue(
'Test'));
    46         $this->setGlobalVariable(
'lng', $lng_mock);
    48         $this->setGlobalVariable(
'ilias', $this->getIliasMock());
    49         $this->setGlobalVariable(
'ilDB', $this->getDatabaseMock());
  
 
 
◆ test_cleanQuestionText_shouldReturnCleanedText()
      
        
          | assClozeTestTest::test_cleanQuestionText_shouldReturnCleanedText  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 59 of file assClozeTestTest.php.
   62         $in_text = 
'Ein <gap>Männlein</gap> steht <gap id="Walter">im</gap> <b>Walde</b> ganz <gap 2>still</gap> und [gap]stumm[/gap]<hr />';
    63         $expected = 
'Ein [gap]Männlein[/gap] steht [gap]im[/gap] <b>Walde</b> ganz [gap]still[/gap] und [gap]stumm[/gap]<hr />';
    65         $actual = $instance->cleanQuestiontext($in_text);
    67         $this->assertEquals($expected, $actual);
 
 
 
 
◆ test_getAdditionalTableName_shouldReturnAdditionalTableName()
      
        
          | assClozeTestTest::test_getAdditionalTableName_shouldReturnAdditionalTableName  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 155 of file assClozeTestTest.php.
  158         $expected = 
'qpl_qst_cloze';
   160         $actual = $instance->getAdditionalTableName();
   162         $this->assertEquals($expected, $actual);
 
 
 
 
◆ test_getAnswerTableName_shouldReturnAnswerTableName()
      
        
          | assClozeTestTest::test_getAnswerTableName_shouldReturnAnswerTableName  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 165 of file assClozeTestTest.php.
  168         $expected = [
"qpl_a_cloze",
'qpl_a_cloze_combi_res'];
   170         $actual = $instance->getAnswerTableName();
   172         $this->assertEquals($expected, $actual);
 
 
 
 
◆ test_getQuestionType_shouldReturnQuestionType()
      
        
          | assClozeTestTest::test_getQuestionType_shouldReturnQuestionType  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 134 of file assClozeTestTest.php.
  137         $expected = 
'assClozeTest';
   139         $actual = $instance->getQuestionType();
   141         $this->assertEquals($expected, $actual);
 
 
 
 
◆ test_instantiateObject_shouldReturnInstance()
      
        
          | assClozeTestTest::test_instantiateObject_shouldReturnInstance  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 52 of file assClozeTestTest.php.
   56         $this->assertInstanceOf(assClozeTest::class, $instance);
 
 
 
 
◆ test_isComplete_shouldReturnFalseIfIncomplete()
      
        
          | assClozeTestTest::test_isComplete_shouldReturnFalseIfIncomplete  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 70 of file assClozeTestTest.php.
   75         $actual = $instance->isComplete();
    77         $this->assertEquals($expected, $actual);
 
 
 
 
◆ test_setGetEndTag_defaultShoulBeApplied()
      
        
          | assClozeTestTest::test_setGetEndTag_defaultShoulBeApplied  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 118 of file assClozeTestTest.php.
  121         $alternate_tag = 
'</gappo_the_great>';
   122         $expected = 
'[/gap]';
   124         $instance->setEndTag($alternate_tag);
   125         $intermediate = $instance->getEndTag();
   126         $this->assertEquals($alternate_tag, $intermediate);
   128         $instance->setEndTag();
   129         $actual = $instance->getEndTag();
   131         $this->assertEquals($expected, $actual);
 
 
 
 
◆ test_setGetEndTag_shouldReturnValueUnchanged()
      
        
          | assClozeTestTest::test_setGetEndTag_shouldReturnValueUnchanged  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 107 of file assClozeTestTest.php.
  110         $expected = 
'</gappo_the_great>';
   112         $instance->setEndTag($expected);
   113         $actual = $instance->getEndTag();
   115         $this->assertEquals($expected, $actual);
 
 
 
 
◆ test_setGetFixedTextLength_shouldReturnValueUnchanged()
      
        
          | assClozeTestTest::test_setGetFixedTextLength_shouldReturnValueUnchanged  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 175 of file assClozeTestTest.php.
  180         $instance->setFixedTextLength($expected);
   181         $actual = $instance->getFixedTextLength();
   183         $this->assertEquals($expected, $actual);
 
 
 
 
◆ test_setGetIdenticalScoring_shouldReturnValueUnchanged()
      
        
          | assClozeTestTest::test_setGetIdenticalScoring_shouldReturnValueUnchanged  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 144 of file assClozeTestTest.php.
  149         $instance->setIdenticalScoring(
true);
   150         $actual = $instance->getIdenticalScoring();
   152         $this->assertEquals($expected, $actual);
 
 
 
 
◆ test_setGetStartTag_defaultShoulBeApplied()
      
        
          | assClozeTestTest::test_setGetStartTag_defaultShoulBeApplied  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 91 of file assClozeTestTest.php.
   94         $alternate_tag = 
'<gappo_the_great>';
    97         $instance->setStartTag($alternate_tag);
    98         $intermediate = $instance->getStartTag();
    99         $this->assertEquals($alternate_tag, $intermediate);
   101         $instance->setStartTag();
   102         $actual = $instance->getStartTag();
   104         $this->assertEquals($expected, $actual);
 
 
 
 
◆ test_setGetStartTag_shouldReturnValueUnchanged()
      
        
          | assClozeTestTest::test_setGetStartTag_shouldReturnValueUnchanged  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 80 of file assClozeTestTest.php.
   83         $expected = 
'<gappo_the_great>';
    85         $instance->setStartTag($expected);
    86         $actual = $instance->getStartTag();
    88         $this->assertEquals($expected, $actual);
 
 
 
 
◆ $backupGlobals
  
  
      
        
          | assClozeTestTest::$backupGlobals = false | 
         
       
   | 
  
protected   | 
  
 
 
The documentation for this class was generated from the following file: