ILIAS  release_7 Revision v7.30-3-g800a261c036
ilStudyProgrammeAssignmentTest Class Reference
+ Inheritance diagram for ilStudyProgrammeAssignmentTest:
+ Collaboration diagram for ilStudyProgrammeAssignmentTest:

Public Member Functions

 testInitAndId ()
 
 testRootId ()
 @depends testInitAndId More...
 
 testUserId ()
 @depends testInitAndId More...
 
 testWithLastChange ()
 @depends testInitAndId More...
 
 testRestartDate ()
 @depends testInitAndId More...
 

Protected Attributes

 $backupGlobals = false
 

Detailed Description

Definition at line 5 of file ilStudyProgrammeAssignmentTest.php.

Member Function Documentation

◆ testInitAndId()

ilStudyProgrammeAssignmentTest::testInitAndId ( )

Definition at line 9 of file ilStudyProgrammeAssignmentTest.php.

10 {
11 $spa = new ilStudyProgrammeAssignment(123);
12 $this->assertEquals($spa->getId(), 123);
13 return $spa;
14 }
Represents one assignment of the user to a program tree.

◆ testRestartDate()

ilStudyProgrammeAssignmentTest::testRestartDate ( )

@depends testInitAndId

Definition at line 51 of file ilStudyProgrammeAssignmentTest.php.

51 : void
52 {
53 $dl = DateTimeImmutable::createFromFormat('Ymd', '20201001');
54 $spa = (new ilStudyProgrammeAssignment(123))->withRestarted(321, $dl);
55 $this->assertEquals($spa->getRestartDate()->format('Ymd'), '20201001');
56 $this->assertEquals($spa->getRestartedAssignmentId(), 321);
57 }

◆ testRootId()

ilStudyProgrammeAssignmentTest::testRootId ( )

@depends testInitAndId

Definition at line 19 of file ilStudyProgrammeAssignmentTest.php.

19 : void
20 {
21 $spa = (new ilStudyProgrammeAssignment(123))->withRootId(321);
22 $this->assertEquals($spa->getRootId(), 321);
23 }

◆ testUserId()

ilStudyProgrammeAssignmentTest::testUserId ( )

@depends testInitAndId

Definition at line 28 of file ilStudyProgrammeAssignmentTest.php.

28 : void
29 {
30 $spa = (new ilStudyProgrammeAssignment(123))->withUserId(321);
31 $this->assertEquals($spa->getUserId(), 321);
32 }

◆ testWithLastChange()

ilStudyProgrammeAssignmentTest::testWithLastChange ( )

@depends testInitAndId

Definition at line 37 of file ilStudyProgrammeAssignmentTest.php.

37 : void
38 {
39 $spa = (new ilStudyProgrammeAssignment(123))->withLastChange(
40 6,
41 $now = new DateTimeImmutable()
42 );
43 $this->assertEquals($spa->getLastChangeBy(), 6);
44 $this->assertEquals($spa->getLastChange()->format('Y-m-d H:i:s'), $now->format('Y-m-d H:i:s'));
45 }

Field Documentation

◆ $backupGlobals

ilStudyProgrammeAssignmentTest::$backupGlobals = false
protected

Definition at line 7 of file ilStudyProgrammeAssignmentTest.php.


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