ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
assAnswerMultipleResponseImageTest Class Reference

Unit tests. More...

+ Inheritance diagram for assAnswerMultipleResponseImageTest:
+ Collaboration diagram for assAnswerMultipleResponseImageTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 test_setGetImage ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $backupGlobals = false
 

Detailed Description

Unit tests.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de

Definition at line 11 of file assAnswerMultipleResponseImageTest.php.

Member Function Documentation

◆ setUp()

assAnswerMultipleResponseImageTest::setUp ( )
protected

Definition at line 15 of file assAnswerMultipleResponseImageTest.php.

References defined.

16  {
17  if (defined('ILIAS_PHPUNIT_CONTEXT')) {
18  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
19  ilUnitUtil::performInitialisation();
20  } else {
21  chdir(dirname(__FILE__));
22  chdir('../../../');
23  }
24  }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

◆ test_instantiateObject_shouldReturnInstance()

assAnswerMultipleResponseImageTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 26 of file assAnswerMultipleResponseImageTest.php.

27  {
28  // Arrange
29  require_once './Modules/TestQuestionPool/classes/class.assAnswerMultipleResponseImage.php';
30 
31  // Act
32  $instance = new ASS_AnswerMultipleResponseImage();
33 
34  $this->assertInstanceOf('ASS_AnswerMultipleResponseImage', $instance);
35  }
ASS_AnswerBinaryStateImage is a class for answers with a binary state indicator (checked/unchecked, set/unset) and an image file.

◆ test_setGetImage()

assAnswerMultipleResponseImageTest::test_setGetImage ( )

Definition at line 37 of file assAnswerMultipleResponseImageTest.php.

38  {
39  // Arrange
40  require_once './Modules/TestQuestionPool/classes/class.assAnswerMultipleResponseImage.php';
41  $instance = new ASS_AnswerMultipleResponseImage();
42  $expected = 'c:\image.jpg';
43 
44  // Act
45  $instance->setImage($expected);
46  $actual = $instance->getImage();
47 
48  // Assert
49  $this->assertEquals($expected, $actual);
50  }
ASS_AnswerBinaryStateImage is a class for answers with a binary state indicator (checked/unchecked, set/unset) and an image file.

Field Documentation

◆ $backupGlobals

assAnswerMultipleResponseImageTest::$backupGlobals = false
protected

Definition at line 13 of file assAnswerMultipleResponseImageTest.php.


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