ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilStudyProgrammeAssignmentTest Class Reference

@group needsInstalledILIAS More...

+ Inheritance diagram for ilStudyProgrammeAssignmentTest:
+ Collaboration diagram for ilStudyProgrammeAssignmentTest:

Public Member Functions

 setUp ()
 
 test_init_and_id ()
 
 test_root_id ()
 @depends test_init_and_id More...
 
 test_user_id ()
 @depends test_init_and_id More...
 
 test_last_change_by ()
 @depends test_init_and_id More...
 
 test_last_change_by_invalid ()
 @depends test_init_and_id @expectedException ilException More...
 
 test_last_change ()
 @depends test_init_and_id More...
 
 test_restart_date ()
 @depends test_init_and_id More...
 
 test_restarted_assigment ()
 @depends test_init_and_id More...
 

Protected Attributes

 $backupGlobals = false
 

Detailed Description

@group needsInstalledILIAS

Definition at line 6 of file ilStudyProgrammeAssignmentTest.php.

Member Function Documentation

◆ setUp()

ilStudyProgrammeAssignmentTest::setUp ( )

Definition at line 10 of file ilStudyProgrammeAssignmentTest.php.

10 : void
11 {
12 PHPUnit_Framework_Error_Deprecated::$enabled = false;
13
14 global $DIC;
15 if (!$DIC) {
16 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
17 try {
18 ilUnitUtil::performInitialisation();
19 } catch (\Exception $e) {
20 }
21 }
22 }
$DIC
Definition: xapitoken.php:46

References $DIC, and Vendor\Package\$e.

◆ test_init_and_id()

ilStudyProgrammeAssignmentTest::test_init_and_id ( )

Definition at line 24 of file ilStudyProgrammeAssignmentTest.php.

25 {
26 $spa = new ilStudyProgrammeAssignment(123);
27 $this->assertEquals($spa->getId(), 123);
28 return $spa;
29 }
Class ilStudyProgrammeAssignment.

◆ test_last_change()

ilStudyProgrammeAssignmentTest::test_last_change ( )

@depends test_init_and_id

Definition at line 70 of file ilStudyProgrammeAssignmentTest.php.

71 {
72 $dl = new DateTime();
73 $spa = (new ilStudyProgrammeAssignment(123))->setLastChange($dl);
74 $this->assertEquals($spa->getLastChange()->format('Y-m-d H:i:s'), $dl->format('Y-m-d H:i:s'));
75 }

◆ test_last_change_by()

ilStudyProgrammeAssignmentTest::test_last_change_by ( )

@depends test_init_and_id

Definition at line 52 of file ilStudyProgrammeAssignmentTest.php.

53 {
54 $spa = (new ilStudyProgrammeAssignment(123))->setLastChangeBy(6);
55 $this->assertEquals($spa->getLastChangeBy(), 6);
56 }

◆ test_last_change_by_invalid()

ilStudyProgrammeAssignmentTest::test_last_change_by_invalid ( )

@depends test_init_and_id @expectedException ilException

Definition at line 62 of file ilStudyProgrammeAssignmentTest.php.

63 {
64 $spa = (new ilStudyProgrammeAssignment(123))->setLastChangeBy(-55);
65 }

◆ test_restart_date()

ilStudyProgrammeAssignmentTest::test_restart_date ( )

@depends test_init_and_id

Definition at line 80 of file ilStudyProgrammeAssignmentTest.php.

81 {
82 $dl = DateTime::createFromFormat('Ymd', '20201001');
83 $spa = (new ilStudyProgrammeAssignment(123))->setRestartDate($dl);
84 $this->assertEquals($spa->getRestartDate()->format('Ymd'), '20201001');
85 }

◆ test_restarted_assigment()

ilStudyProgrammeAssignmentTest::test_restarted_assigment ( )

@depends test_init_and_id

Definition at line 91 of file ilStudyProgrammeAssignmentTest.php.

92 {
93 $spa = new ilStudyProgrammeAssignment(123);
94 $this->assertEquals($spa->getRestartedAssignmentId(), ilStudyProgrammeAssignment::NO_RESTARTED_ASSIGNMENT);
95 $this->assertEquals($spa->setRestartedAssignmentId(321)->getRestartedAssignmentId(), 321);
96 }

References ilStudyProgrammeAssignment\NO_RESTARTED_ASSIGNMENT.

◆ test_root_id()

ilStudyProgrammeAssignmentTest::test_root_id ( )

@depends test_init_and_id

Definition at line 34 of file ilStudyProgrammeAssignmentTest.php.

35 {
36 $spa = (new ilStudyProgrammeAssignment(123))->setRootId(321);
37 $this->assertEquals($spa->getRootId(), 321);
38 }

◆ test_user_id()

ilStudyProgrammeAssignmentTest::test_user_id ( )

@depends test_init_and_id

Definition at line 43 of file ilStudyProgrammeAssignmentTest.php.

44 {
45 $spa = (new ilStudyProgrammeAssignment(123))->setUserId(321);
46 $this->assertEquals($spa->getUserId(), 321);
47 }

Field Documentation

◆ $backupGlobals

ilStudyProgrammeAssignmentTest::$backupGlobals = false
protected

Definition at line 8 of file ilStudyProgrammeAssignmentTest.php.


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