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

Unit tests. More...

+ Inheritance diagram for assAnswerClozeTest:
+ Collaboration diagram for assAnswerClozeTest:

Public Member Functions

 test_constructorShouldReturnInstance ()
 test_setGetLowerBound ()
 test_setGetLowerBond_GreaterThanAnswerShouldSetAnswertext ()
 test_setGetLowerBound_nonNumericShouldSetAnswertext ()
 test_setGetUpperBound ()
 test_setGetUpperBound_smallerThanAnswerShouldSetAnswertext ()
 test_setGetUpperBound_nonNumericShouldSetAnswertext ()

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

Member Function Documentation

assAnswerClozeTest::setUp ( )
protected

Definition at line 15 of file assAnswerClozeTest.php.

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

Definition at line 29 of file assAnswerClozeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
// Act
$instance = new assAnswerCloze();
// Assert
$this->assertNotNull($instance);
}
assAnswerClozeTest::test_setGetLowerBond_GreaterThanAnswerShouldSetAnswertext ( )

Definition at line 56 of file assAnswerClozeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
$instance = new assAnswerCloze('2');
// Act
$expected = '2';
$instance->setLowerBound(4);
$actual = $instance->getLowerBound();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerClozeTest::test_setGetLowerBound ( )

Definition at line 41 of file assAnswerClozeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
$instance = new assAnswerCloze('2');
// Act
$expected = '1';
$instance->setLowerBound($expected);
$actual = $instance->getLowerBound();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerClozeTest::test_setGetLowerBound_nonNumericShouldSetAnswertext ( )

Definition at line 71 of file assAnswerClozeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
$instance = new assAnswerCloze('2');
// Act
$expected = '2';
$instance->setLowerBound('test');
$actual = $instance->getLowerBound();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerClozeTest::test_setGetUpperBound ( )

Definition at line 86 of file assAnswerClozeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
$instance = new assAnswerCloze('1');
// Act
$expected = '3';
$instance->setUpperBound($expected);
$actual = $instance->getUpperBound();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerClozeTest::test_setGetUpperBound_nonNumericShouldSetAnswertext ( )

Definition at line 116 of file assAnswerClozeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
$instance = new assAnswerCloze('4');
// Act
$expected = '4';
$instance->setUpperBound('test');
$actual = $instance->getUpperBound();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerClozeTest::test_setGetUpperBound_smallerThanAnswerShouldSetAnswertext ( )

Definition at line 101 of file assAnswerClozeTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
$instance = new assAnswerCloze('4');
// Act
$expected = '4';
$instance->setUpperBound(2);
$actual = $instance->getUpperBound();
// Assert
$this->assertEquals($expected, $actual);
}

Field Documentation

assAnswerClozeTest::$backupGlobals = FALSE
protected

Definition at line 13 of file assAnswerClozeTest.php.


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