ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
assAnswerMultipleResponseTest Class Reference

Unit tests. More...

+ Inheritance diagram for assAnswerMultipleResponseTest:
+ Collaboration diagram for assAnswerMultipleResponseTest:

Public Member Functions

 test_instantiateObjectSimple ()
 test_setGetPointsUnchecked ()
 test_setGetPointsUnchecked_InvalidPointsBecomeZero ()
 test_setGetPointsChecked ()

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 assAnswerMultipleResponseTest.php.

Member Function Documentation

assAnswerMultipleResponseTest::setUp ( )
protected

Definition at line 15 of file assAnswerMultipleResponseTest.php.

{
if (defined('ILIAS_PHPUNIT_CONTEXT'))
{
include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
ilUnitUtil::performInitialisation();
}
else
{
chdir( dirname( __FILE__ ) );
chdir('../../../');
}
}
assAnswerMultipleResponseTest::test_instantiateObjectSimple ( )

Definition at line 29 of file assAnswerMultipleResponseTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerMultipleResponse.php';
// Act
$instance = new ASS_AnswerMultipleResponse();
// Assert
$this->assertInstanceOf('ASS_AnswerMultipleResponse', $instance);
}
assAnswerMultipleResponseTest::test_setGetPointsChecked ( )

Definition at line 71 of file assAnswerMultipleResponseTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerMultipleResponse.php';
$instance = new ASS_AnswerMultipleResponse();
$expected = 2;
// Act
$instance->setPointsChecked($expected);
$actual = $instance->getPointsChecked();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerMultipleResponseTest::test_setGetPointsUnchecked ( )

Definition at line 41 of file assAnswerMultipleResponseTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerMultipleResponse.php';
$instance = new ASS_AnswerMultipleResponse();
$expected = 1;
// Act
$instance->setPointsUnchecked($expected);
$actual = $instance->getPointsUnchecked();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerMultipleResponseTest::test_setGetPointsUnchecked_InvalidPointsBecomeZero ( )

Definition at line 56 of file assAnswerMultipleResponseTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerMultipleResponse.php';
$instance = new ASS_AnswerMultipleResponse();
$expected = 0;
// Act
$instance->setPointsUnchecked('Günther');
$actual = $instance->getPointsUnchecked();
// Assert
$this->assertEquals($expected, $actual);
}

Field Documentation

assAnswerMultipleResponseTest::$backupGlobals = FALSE
protected

Definition at line 13 of file assAnswerMultipleResponseTest.php.


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