ILIAS  release_4-3 Revision
 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 31 of file assAnswerClozeTest.php.

Member Function Documentation

assAnswerClozeTest::setUp ( )
protected

Definition at line 35 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 49 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 76 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 61 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 91 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 106 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 136 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 121 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 33 of file assAnswerClozeTest.php.


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