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

Unit tests. More...

+ Inheritance diagram for assAnswerTrueFalseTest:
+ Collaboration diagram for assAnswerTrueFalseTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 test_setGetCorrectness_shouldReturnUnchangedState ()
 test_isTrue_shouldReturnTrue ()
 test_isFalse_shouldReturnFalseOnTrueState ()
 test_setFalseGetCorrectness_shouldReturnFalse ()
 : Fix bug! getCorrectness returns int instead of bool.
 test_setTrueIsTrue_shouldReturnUnchangedState ()
 test_setFalseIsFalse_shouldReturnUnchangedState ()

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

Member Function Documentation

assAnswerTrueFalseTest::setUp ( )
protected

Definition at line 15 of file assAnswerTrueFalseTest.php.

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

Definition at line 29 of file assAnswerTrueFalseTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerTrueFalse.php';
// Act
$instance = new ASS_AnswerTrueFalse();
$this->assertInstanceOf('ASS_AnswerTrueFalse', $instance);
}
assAnswerTrueFalseTest::test_isFalse_shouldReturnFalseOnTrueState ( )

Definition at line 70 of file assAnswerTrueFalseTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerTrueFalse.php';
$instance = new ASS_AnswerTrueFalse();
$expected = false;
// Act
$instance->setCorrectness(true);
// Assert
$this->assertEquals($expected, $instance->isFalse());
$this->assertEquals($expected, $instance->isIncorrect());
}
assAnswerTrueFalseTest::test_isTrue_shouldReturnTrue ( )

Definition at line 55 of file assAnswerTrueFalseTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerTrueFalse.php';
$instance = new ASS_AnswerTrueFalse();
$expected = true;
// Act
$instance->setCorrectness($expected);
// Assert
$this->assertEquals($expected, $instance->isTrue());
$this->assertEquals($expected, $instance->isCorrect());
}
assAnswerTrueFalseTest::test_setFalseGetCorrectness_shouldReturnFalse ( )

: Fix bug! getCorrectness returns int instead of bool.

Definition at line 88 of file assAnswerTrueFalseTest.php.

{
$this->markTestIncomplete('Bug detected, fix not applied yet due to poor coverage.');
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerTrueFalse.php';
$instance = new ASS_AnswerTrueFalse();
$expected = false;
// Act
$instance->setFalse();
$actual = $instance->getCorrectness();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerTrueFalseTest::test_setFalseIsFalse_shouldReturnUnchangedState ( )

Definition at line 120 of file assAnswerTrueFalseTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerTrueFalse.php';
$instance = new ASS_AnswerTrueFalse();
$expected = true;
// Act
$instance->setFalse();
$actual = $instance->isFalse();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerTrueFalseTest::test_setGetCorrectness_shouldReturnUnchangedState ( )

Definition at line 40 of file assAnswerTrueFalseTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerTrueFalse.php';
$instance = new ASS_AnswerTrueFalse();
$expected = true;
// Act
$instance->setCorrectness($expected);
$actual = $instance->getCorrectness();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerTrueFalseTest::test_setTrueIsTrue_shouldReturnUnchangedState ( )

Definition at line 105 of file assAnswerTrueFalseTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerTrueFalse.php';
$instance = new ASS_AnswerTrueFalse();
$expected = true;
// Act
$instance->setTrue();
$actual = $instance->isTrue();
// Assert
$this->assertEquals($expected, $actual);
}

Field Documentation

assAnswerTrueFalseTest::$backupGlobals = FALSE
protected

Definition at line 13 of file assAnswerTrueFalseTest.php.


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