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

Member Function Documentation

assAnswerBinaryStateTest::setUp ( )
protected

Definition at line 35 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 49 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 75 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 91 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 123 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 107 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 138 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 60 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 170 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 154 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 186 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 33 of file assAnswerBinaryStateTest.php.


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