ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilQTIParserTest Class Reference
+ Inheritance diagram for ilQTIParserTest:
+ Collaboration diagram for ilQTIParserTest:

Public Member Functions

 testConstruct ()
 
 testSetGetQuestionSetType ()
 
 testSetTestObject ()
 
 testSetGetIliasSourceVersionWithoutPatch ()
 
 testSetGetIliasSourceVersionWithPatch ()
 
 testSetGetIliasSourceVersionWithoutDate ()
 

Protected Member Functions

 setup ()
 
 tearDown ()
 
 fetchNumericVersionFromVersionDateString (string $version)
 

Detailed Description

Definition at line 25 of file ilQTIParserTest.php.

Member Function Documentation

◆ fetchNumericVersionFromVersionDateString()

ilQTIParserTest::fetchNumericVersionFromVersionDateString ( string  $version)
protected

Definition at line 76 of file ilQTIParserTest.php.

Referenced by testSetGetIliasSourceVersionWithoutDate(), testSetGetIliasSourceVersionWithoutPatch(), and testSetGetIliasSourceVersionWithPatch().

76  : string
77  {
78  $instance = new ilQTIParser('dummy xml file');
79  $reflection = new ReflectionClass($instance);
80  $method = $reflection->getMethod('fetchNumericVersionFromVersionDateString');
81  $method->setAccessible(true);
82  return $method->invoke($instance, $version);
83  }
$version
Definition: plugin.php:24
+ Here is the caller graph for this function:

◆ setup()

ilQTIParserTest::setup ( )
protected

Definition at line 50 of file ilQTIParserTest.php.

References $GLOBALS.

50  : void
51  {
52  $GLOBALS['DIC'] = $this->getMockBuilder(Container::class)->disableOriginalConstructor()->getMock();
53  $GLOBALS['DIC']->expects(self::any())->method('isDependencyAvailable')->with('language')->willReturn(false);
54  }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64

◆ tearDown()

ilQTIParserTest::tearDown ( )
protected

Definition at line 56 of file ilQTIParserTest.php.

References $GLOBALS.

56  : void
57  {
58  unset($GLOBALS['DIC']);
59  }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64

◆ testConstruct()

ilQTIParserTest::testConstruct ( )

Definition at line 27 of file ilQTIParserTest.php.

27  : void
28  {
29  $this->assertInstanceOf(ilQTIParser::class, new ilQTIParser('dummy xml file'));
30  }

◆ testSetGetIliasSourceVersionWithoutDate()

ilQTIParserTest::testSetGetIliasSourceVersionWithoutDate ( )

Definition at line 71 of file ilQTIParserTest.php.

References fetchNumericVersionFromVersionDateString().

71  : void
72  {
73  $this->assertEquals('8.14', $this->fetchNumericVersionFromVersionDateString('8.14'));
74  }
fetchNumericVersionFromVersionDateString(string $version)
+ Here is the call graph for this function:

◆ testSetGetIliasSourceVersionWithoutPatch()

ilQTIParserTest::testSetGetIliasSourceVersionWithoutPatch ( )

Definition at line 61 of file ilQTIParserTest.php.

References fetchNumericVersionFromVersionDateString().

61  : void
62  {
63  $this->assertEquals('7.13', $this->fetchNumericVersionFromVersionDateString('7.13 2022-08-31'));
64  }
fetchNumericVersionFromVersionDateString(string $version)
+ Here is the call graph for this function:

◆ testSetGetIliasSourceVersionWithPatch()

ilQTIParserTest::testSetGetIliasSourceVersionWithPatch ( )

Definition at line 66 of file ilQTIParserTest.php.

References fetchNumericVersionFromVersionDateString().

66  : void
67  {
68  $this->assertEquals('5.4.22', $this->fetchNumericVersionFromVersionDateString('5.4.22 2021-05-14'));
69  }
fetchNumericVersionFromVersionDateString(string $version)
+ Here is the call graph for this function:

◆ testSetGetQuestionSetType()

ilQTIParserTest::testSetGetQuestionSetType ( )

Definition at line 32 of file ilQTIParserTest.php.

32  : void
33  {
34  $instance = new ilQTIParser('dummy xml file');
35  $instance->setQuestionSetType('Some input.');
36  $this->assertEquals('Some input.', $instance->getQuestionSetType());
37  }

◆ testSetTestObject()

ilQTIParserTest::testSetTestObject ( )

Definition at line 39 of file ilQTIParserTest.php.

References $id.

39  : void
40  {
41  $id = 8098;
42  $test = $this->getMockBuilder(ilObjTest::class)->disableOriginalConstructor()->getMock();
43  $test->expects(self::once())->method('getId')->willReturn($id);
44  $instance = new ilQTIParser('dummy xml file');
45  $instance->setTestObject($test);
46  $this->assertEquals($test, $instance->tst_object);
47  $this->assertEquals($id, $instance->tst_id);
48  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

The documentation for this class was generated from the following file: