ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
assAnswerErrorTextTest Class Reference

Unit tests for assAnswerErrorTextTest. More...

+ Inheritance diagram for assAnswerErrorTextTest:
+ Collaboration diagram for assAnswerErrorTextTest:

Public Member Functions

 test_instantiateObjectSimple ()
 test_instantiateObjectFull ()
 test_setGetPoints_valid ()
 test_setPoints_invalid ()
 test_setGetTextCorrect ()
 test_setGetTextWrong_valid ()
 test_setTextWrong_invalid ()
 test_setGetUnknown ()

Protected Member Functions

 setUp ()

Protected Attributes

 $backupGlobals = FALSE

Detailed Description

Unit tests for assAnswerErrorTextTest.

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

Definition at line 11 of file assAnswerErrorTextTest.php.

Member Function Documentation

assAnswerErrorTextTest::setUp ( )
protected

Definition at line 15 of file assAnswerErrorTextTest.php.

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

Definition at line 42 of file assAnswerErrorTextTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerErrorText.php';
// Act
$instance = new assAnswerErrorText(
'errortext',
'correcttext',
1
);
// Assert
$this->assertTrue(TRUE);
}
assAnswerErrorTextTest::test_instantiateObjectSimple ( )

Definition at line 29 of file assAnswerErrorTextTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerErrorText.php';
// Act
$instance = new assAnswerErrorText('errortext');
// Assert
$this->assertTrue(TRUE);
}
assAnswerErrorTextTest::test_setGetPoints_valid ( )

Definition at line 58 of file assAnswerErrorTextTest.php.

{
//$this->markTestIncomplete('Testing an uncommitted feature.');
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerErrorText.php';
$instance = new assAnswerErrorText( 'errortext' );
$expected = 0.01;
// Act
$instance->points = $expected;
$actual = $instance->points;
// Assert
$this->assertEquals($actual, $expected);
}
assAnswerErrorTextTest::test_setGetTextCorrect ( )

Definition at line 88 of file assAnswerErrorTextTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerErrorText.php';
$instance = new assAnswerErrorText( 'errortext' );
$expected = 'Correct text';
// Act
$instance->text_correct = $expected;
$actual = $instance->text_correct;
// Assert
$this->assertEquals($actual, $expected);
}
assAnswerErrorTextTest::test_setGetTextWrong_valid ( )

Definition at line 103 of file assAnswerErrorTextTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerErrorText.php';
$instance = new assAnswerErrorText( 'errortext' );
$expected = 'Errortext';
// Act
$instance->text_wrong = $expected;
$actual = $instance->text_wrong;
// Assert
$this->assertEquals($actual, $expected);
}
assAnswerErrorTextTest::test_setGetUnknown ( )

Definition at line 133 of file assAnswerErrorTextTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerErrorText.php';
$instance = new assAnswerErrorText( 'errortext' );
$expected = null;
// Act
$instance->undefined123 = 'No expectations';
$actual = $instance->undefined123;
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerErrorTextTest::test_setPoints_invalid ( )

Definition at line 74 of file assAnswerErrorTextTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerErrorText.php';
$instance = new assAnswerErrorText( 'errortext' );
$expected = 'hokum';
// Act
$instance->points = $expected;
$actual = $instance->points;
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerErrorTextTest::test_setTextWrong_invalid ( )

Definition at line 118 of file assAnswerErrorTextTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerErrorText.php';
$instance = new assAnswerErrorText( 'errortext' );
$expected = '';
// Act
$instance->text_wrong = $expected;
$actual = $instance->text_wrong;
// Assert
$this->assertEquals($expected, $actual);
}

Field Documentation

assAnswerErrorTextTest::$backupGlobals = FALSE
protected

Definition at line 13 of file assAnswerErrorTextTest.php.


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