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

Unit tests. More...

+ Inheritance diagram for assAnswerBinaryStateTest:
+ Collaboration diagram for assAnswerBinaryStateTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 test_setGetState_shouldReturnUnchangedState ()
 test_isStateChecked_shouldReturnActualState ()
 test_isStateSet_shouldReturnActualState ()
 test_isStateUnset_shouldReturnActualState ()
 test_isStateUnchecked_shouldReturnActualState ()
 test_setChecked_shouldAlterState ()
 test_setUnchecked_shouldAlterState ()
 test_setSet_shouldAlterState ()
 test_setUnset_shouldAlterState ()

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

Member Function Documentation

assAnswerBinaryStateTest::setUp ( )
protected

Definition at line 15 of file assAnswerBinaryStateTest.php.

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

Definition at line 29 of file assAnswerBinaryStateTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
// Act
$instance = new ASS_AnswerBinaryState();
$this->assertInstanceOf('ASS_AnswerBinaryState', $instance);
}
assAnswerBinaryStateTest::test_isStateChecked_shouldReturnActualState ( )

Definition at line 55 of file assAnswerBinaryStateTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
$instance = new ASS_AnswerBinaryState();
$expected = 1;
// Act
$instance->setState($expected);
$actual = $instance->isStateChecked();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerBinaryStateTest::test_isStateSet_shouldReturnActualState ( )

Definition at line 70 of file assAnswerBinaryStateTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
$instance = new ASS_AnswerBinaryState();
$expected = 1;
// Act
$instance->setState($expected);
$actual = $instance->isStateSet();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerBinaryStateTest::test_isStateUnchecked_shouldReturnActualState ( )

Definition at line 100 of file assAnswerBinaryStateTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
$instance = new ASS_AnswerBinaryState();
$expected = 1;
// Act
$instance->setState($expected);
$actual = !$instance->isStateUnchecked();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerBinaryStateTest::test_isStateUnset_shouldReturnActualState ( )

Definition at line 85 of file assAnswerBinaryStateTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
$instance = new ASS_AnswerBinaryState();
$expected = 1;
// Act
$instance->setState($expected);
$actual = !$instance->isStateUnset();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerBinaryStateTest::test_setChecked_shouldAlterState ( )

Definition at line 115 of file assAnswerBinaryStateTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
$instance = new ASS_AnswerBinaryState();
$expected = 0;
$instance->setState($expected);
// Act
$instance->setChecked();
$actual = $instance->isStateUnchecked();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerBinaryStateTest::test_setGetState_shouldReturnUnchangedState ( )

Definition at line 40 of file assAnswerBinaryStateTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
$instance = new ASS_AnswerBinaryState();
$expected = 1;
// Act
$instance->setState($expected);
$actual = $instance->getState();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerBinaryStateTest::test_setSet_shouldAlterState ( )

Definition at line 147 of file assAnswerBinaryStateTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
$instance = new ASS_AnswerBinaryState();
$expected = 0;
$instance->setState($expected);
// Act
$instance->setSet();
$actual = $instance->isStateUnchecked();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerBinaryStateTest::test_setUnchecked_shouldAlterState ( )

Definition at line 131 of file assAnswerBinaryStateTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
$instance = new ASS_AnswerBinaryState();
$expected = 1;
$instance->setState($expected);
// Act
$instance->setUnchecked();
$actual = $instance->isStateUnchecked();
// Assert
$this->assertEquals($expected, $actual);
}
assAnswerBinaryStateTest::test_setUnset_shouldAlterState ( )

Definition at line 163 of file assAnswerBinaryStateTest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php';
$instance = new ASS_AnswerBinaryState();
$expected = 1;
$instance->setState($expected);
// Act
$instance->setUnset();
$actual = $instance->isStateUnchecked();
// Assert
$this->assertEquals($expected, $actual);
}

Field Documentation

assAnswerBinaryStateTest::$backupGlobals = FALSE
protected

Definition at line 13 of file assAnswerBinaryStateTest.php.


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