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

Member Function Documentation

assAnswerMatchingTest::setUp ( )
protected

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


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