ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilStudyProgrammeAssignmentTest Class Reference

needsInstalledILIAS More...

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

Public Member Functions

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

Protected Attributes

 $backupGlobals = false
 

Detailed Description

needsInstalledILIAS

Definition at line 6 of file ilStudyProgrammeAssignmentTest.php.

Member Function Documentation

◆ setUp()

ilStudyProgrammeAssignmentTest::setUp ( )

Definition at line 10 of file ilStudyProgrammeAssignmentTest.php.

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

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

◆ 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 ( )

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  }
Class ilStudyProgrammeAssignment.

◆ test_last_change_by()

ilStudyProgrammeAssignmentTest::test_last_change_by ( )

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  }
Class ilStudyProgrammeAssignment.

◆ test_last_change_by_invalid()

ilStudyProgrammeAssignmentTest::test_last_change_by_invalid ( )

test_init_and_id ilException

Definition at line 62 of file ilStudyProgrammeAssignmentTest.php.

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

◆ test_restart_date()

ilStudyProgrammeAssignmentTest::test_restart_date ( )

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  }
Class ilStudyProgrammeAssignment.

◆ test_restarted_assigment()

ilStudyProgrammeAssignmentTest::test_restarted_assigment ( )

test_init_and_id

Definition at line 91 of file ilStudyProgrammeAssignmentTest.php.

References ilStudyProgrammeAssignment\NO_RESTARTED_ASSIGNMENT.

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

◆ test_root_id()

ilStudyProgrammeAssignmentTest::test_root_id ( )

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  }
Class ilStudyProgrammeAssignment.

◆ test_user_id()

ilStudyProgrammeAssignmentTest::test_user_id ( )

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  }
Class ilStudyProgrammeAssignment.

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: