ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilassMarkTest Class Reference

Unit tests for single choice questions. More...

+ Inheritance diagram for ilassMarkTest:
+ Collaboration diagram for ilassMarkTest:

Public Member Functions

 testGetSetShortName ()
 Basic Get/Set test on member short name using accessor methods.
 testGetSetPassed ()
 Basic Get/Set test on member passed using accessor methods.
 testGetSetOfficialName ()
 Basic Get/Set test on member officialName using accessor methods.
 testGetSetMinimumLevel ()
 Basic Get/Set test on member minimumLevel using accessor methods.
 testSetMinimumLevel_High ()
 Set test on member minimumLevel using accessor method with a high level.
 testSetMinimumLevel_Low ()
 Set test on member minimumLevel using accessor methods with a very low level.

Protected Member Functions

 setUp ()

Protected Attributes

 $backupGlobals = FALSE

Detailed Description

Unit tests for single choice questions.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 33 of file ilassMarkTest.php.

Member Function Documentation

ilassMarkTest::setUp ( )
protected

Definition at line 37 of file ilassMarkTest.php.

{
if (defined('ILIAS_PHPUNIT_CONTEXT'))
{
include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
ilUnitUtil::performInitialisation();
}
else
{
chdir( dirname( __FILE__ ) );
chdir('../../../');
}
// Arrange
include_once './Modules/Test/classes/class.assMark.php';
$this->ass_mark = new ASS_Mark();
}
ilassMarkTest::testGetSetMinimumLevel ( )

Basic Get/Set test on member minimumLevel using accessor methods.

Definition at line 117 of file ilassMarkTest.php.

{
// Arrange
$expected = 50;
$this->ass_mark->setMinimumLevel($expected);
// Act
$actual = $this->ass_mark->getMinimumLevel();
// Assert
$this->assertEquals(
$actual,
$expected,
"Get/Set on minimumLevel failed, in/out not matching."
);
}
ilassMarkTest::testGetSetOfficialName ( )

Basic Get/Set test on member officialName using accessor methods.

Definition at line 97 of file ilassMarkTest.php.

{
// Arrange
$expected = "Esther The Tester";
$this->ass_mark->setOfficialName($expected);
// Act
$actual = $this->ass_mark->getOfficialName();
// Assert
$this->assertEquals(
$actual,
$expected,
"Get/Set on officialName failed, in/out not matching."
);
}
ilassMarkTest::testGetSetPassed ( )

Basic Get/Set test on member passed using accessor methods.

Definition at line 77 of file ilassMarkTest.php.

{
// Arrange
$expected = 1;
$this->ass_mark->setPassed($expected);
// Act
$actual = $this->ass_mark->getPassed();
// Assert
$this->assertEquals(
$actual,
$expected,
"Get/Set on passed failed, in/out not matching."
);
}
ilassMarkTest::testGetSetShortName ( )

Basic Get/Set test on member short name using accessor methods.

Definition at line 57 of file ilassMarkTest.php.

{
// Arrange
$expected = "Esther";
$this->ass_mark->setShortName($expected);
// Act
$actual = $this->ass_mark->getShortName();
// Assert
$this->assertEquals(
$actual,
$expected,
"Get/Set on shortName failed, in/out not matching."
);
}
ilassMarkTest::testSetMinimumLevel_High ( )

Set test on member minimumLevel using accessor method with a high level.

Tested method should accept double according to docblock at getMinimumLevel(). Confusingly, setMinimumLevel states that it accepts strings as param, which can be considered an oversight of the author.

Todo:

Enhance documentation of class.assMark.php::setMinimumLevel();

Enhance documentation of class.assMark.php::getMinimumLevel();

Definition at line 146 of file ilassMarkTest.php.

{
// Arrange
$expected = 100;
$this->ass_mark->setMinimumLevel($expected);
// Act
$actual = $this->ass_mark->getMinimumLevel();
// Assert
$this->assertEquals(
$actual,
$expected,
"Set low on minimumLevel failed, in/out not matching."
);
}
ilassMarkTest::testSetMinimumLevel_Low ( )

Set test on member minimumLevel using accessor methods with a very low level.

See Also
testSetMinimumLevel_High()

Definition at line 169 of file ilassMarkTest.php.

{
// Arrange
$expected = 1E-14;
$this->ass_mark->setMinimumLevel($expected);
// Act
$actual = $this->ass_mark->getMinimumLevel();
// Assert
$this->assertEquals(
$actual,
$expected,
"Set low on minimumLevel failed, in/out not matching."
);
}

Field Documentation

ilassMarkTest::$backupGlobals = FALSE
protected

Definition at line 35 of file ilassMarkTest.php.


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