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

Unit tests. More...

+ Inheritance diagram for assAnswerMatchingTest:
+ Collaboration diagram for assAnswerMatchingTest:

Public Member Functions

 test_instantiateObjectSimple ()
 test_setGetPoints ()
 test_setGetTermId ()
 test_setGetPicture ()
 test_setGetPictureId ()
 test_setGetPictureId_NegativeShouldNotSetValue ()
 test_setGetDefinition ()
 test_setGetDefinitionId ()

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

Member Function Documentation

assAnswerMatchingTest::setUp ( )
protected

Definition at line 15 of file assAnswerMatchingTest.php.

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

Definition at line 29 of file assAnswerMatchingTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerMatching.php';
// Act
$instance = new ASS_AnswerMatching();
// Assert
$this->assertInstanceOf('ASS_AnswerMatching',$instance);
}
assAnswerMatchingTest::test_setGetDefinition ( )

Definition at line 116 of file assAnswerMatchingTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerMatching.php';
$instance = new ASS_AnswerMatching();
$expected = 'Definition is this.';
// Act
$instance->setDefinition($expected);
$actual = $instance->getDefinition();
// Assert
$this->assertEquals($expected,$actual);
}
assAnswerMatchingTest::test_setGetDefinitionId ( )

Definition at line 131 of file assAnswerMatchingTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerMatching.php';
$instance = new ASS_AnswerMatching();
$expected = 10;
// Act
$instance->setDefinitionId($expected);
$actual = $instance->getDefinitionId();
// Assert
$this->assertEquals($expected,$actual);
}
assAnswerMatchingTest::test_setGetPicture ( )

Definition at line 71 of file assAnswerMatchingTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerMatching.php';
$instance = new ASS_AnswerMatching();
$expected = '/link/to/image?';
// Act
$instance->setPicture($expected);
$actual = $instance->getPicture();
// Assert
$this->assertEquals($expected,$actual);
}
assAnswerMatchingTest::test_setGetPictureId ( )

Definition at line 86 of file assAnswerMatchingTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerMatching.php';
$instance = new ASS_AnswerMatching();
$expected = 47;
// Act
$instance->setPictureId($expected);
$actual = $instance->getPictureId();
// Assert
$this->assertEquals($expected,$actual);
}
assAnswerMatchingTest::test_setGetPictureId_NegativeShouldNotSetValue ( )

Definition at line 101 of file assAnswerMatchingTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerMatching.php';
$instance = new ASS_AnswerMatching();
$expected = 0;
// Act
$instance->setPictureId(-47);
$actual = $instance->getPictureId();
// Assert
$this->assertEquals($expected,$actual);
}
assAnswerMatchingTest::test_setGetPoints ( )

Definition at line 41 of file assAnswerMatchingTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerMatching.php';
$instance = new ASS_AnswerMatching();
$expected = 10;
// Act
$instance->setPoints($expected);
$actual = $instance->getPoints();
// Assert
$this->assertEquals($expected,$actual);
}
assAnswerMatchingTest::test_setGetTermId ( )

Definition at line 56 of file assAnswerMatchingTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerMatching.php';
$instance = new ASS_AnswerMatching();
$expected = 10;
// Act
$instance->setTermId($expected);
$actual = $instance->getTermId();
// Assert
$this->assertEquals($expected,$actual);
}

Field Documentation

assAnswerMatchingTest::$backupGlobals = FALSE
protected

Definition at line 13 of file assAnswerMatchingTest.php.


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