ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
LSLearnerItemTest Class Reference
+ Inheritance diagram for LSLearnerItemTest:
+ Collaboration diagram for LSLearnerItemTest:

Public Member Functions

 setUp ()
 
 testCreate ()
 
 testTurnedOffWithPostCondition (LSItem $object)
 @depends testCreate More...
 
 testTurnedOffWithOrderNumber (LSItem $object)
 @depends testCreate More...
 
 testTurnedOffWithOnline (LSItem $object)
 @depends testCreate More...
 

Data Fields

const TYPE = "type"
 
const TITLE = "tile"
 
const DESC = "description"
 
const ICON_PATH = "icon_path"
 
const IS_ONLINE = true
 
const ORDER_NUMBER = 10
 
const REF_ID = 30
 
const USER_ID = 6
 
const LP_STATUS = 2
 
const AVAILABILITY_STATUS = 3
 

Protected Attributes

 $post_condition
 

Detailed Description

Definition at line 8 of file LSLearnerItemTest.php.

Member Function Documentation

◆ setUp()

LSLearnerItemTest::setUp ( )

Definition at line 26 of file LSLearnerItemTest.php.

27 {
28 $this->post_condition = new ilLSPostCondition(666, "1");
29 }
A PostCondition does restrict the progression of a user through the learning sequence.

◆ testCreate()

LSLearnerItemTest::testCreate ( )

Definition at line 31 of file LSLearnerItemTest.php.

32 {
33 $ui_reflection = new ReflectionClass(State::class);
34 $methods = array_map(
35 function ($m) {
36 return $m->getName();
37 },
38 $ui_reflection->getMethods()
39 );
40
41 $kiosk_state = $this->getMockBuilder(State::class)
42 ->setMethods($methods)
43 ->getMock()
44 ;
45
46 $ls_item = new LSItem(
47 self::TYPE,
48 self::TITLE,
49 self::DESC,
50 self::ICON_PATH,
51 self::IS_ONLINE,
52 self::ORDER_NUMBER,
53 $this->post_condition,
54 self::REF_ID
55 );
56
57 $object = new LSLearnerItem(
58 self::USER_ID,
59 function () {
60 return self::LP_STATUS;
61 },
63 $kiosk_state,
64 $ls_item
65 );
66
67 $this->assertEquals($object->getUserId(), self::USER_ID);
68 $this->assertEquals($object->getLearningProgressStatus(), self::LP_STATUS);
69 $this->assertEquals($object->getAvailability(), self::AVAILABILITY_STATUS);
70 $this->assertEquals($object->getState(), $kiosk_state);
71
72 return $object;
73 }
Data holding class LSItem .
Definition: LSItem.php:12
Add learning progress and availability information to the LSItem.

References $m, AVAILABILITY_STATUS, and LP_STATUS.

◆ testTurnedOffWithOnline()

LSLearnerItemTest::testTurnedOffWithOnline ( LSItem  $object)

@depends testCreate

Definition at line 96 of file LSLearnerItemTest.php.

97 {
98 $this->expectException(LogicException::class);
99 $object->withOnline(self::IS_ONLINE);
100 }
withOnline(bool $online)
Definition: LSItem.php:98

References LSItem\withOnline().

+ Here is the call graph for this function:

◆ testTurnedOffWithOrderNumber()

LSLearnerItemTest::testTurnedOffWithOrderNumber ( LSItem  $object)

@depends testCreate

Definition at line 87 of file LSLearnerItemTest.php.

88 {
89 $this->expectException(LogicException::class);
90 $object->withOrderNumber(self::ORDER_NUMBER);
91 }
withOrderNumber(int $order_number)
Definition: LSItem.php:110

References LSItem\withOrderNumber().

+ Here is the call graph for this function:

◆ testTurnedOffWithPostCondition()

LSLearnerItemTest::testTurnedOffWithPostCondition ( LSItem  $object)

@depends testCreate

Definition at line 78 of file LSLearnerItemTest.php.

79 {
80 $this->expectException(LogicException::class);
81 $object->withPostCondition($this->post_condition);
82 }
withPostCondition(ilLSPostCondition $postcondition)
Definition: LSItem.php:122

References LSItem\withPostCondition().

+ Here is the call graph for this function:

Field Documentation

◆ $post_condition

LSLearnerItemTest::$post_condition
protected

Definition at line 24 of file LSLearnerItemTest.php.

◆ AVAILABILITY_STATUS

const LSLearnerItemTest::AVAILABILITY_STATUS = 3

Definition at line 19 of file LSLearnerItemTest.php.

Referenced by testCreate().

◆ DESC

const LSLearnerItemTest::DESC = "description"

Definition at line 12 of file LSLearnerItemTest.php.

◆ ICON_PATH

const LSLearnerItemTest::ICON_PATH = "icon_path"

Definition at line 13 of file LSLearnerItemTest.php.

◆ IS_ONLINE

const LSLearnerItemTest::IS_ONLINE = true

Definition at line 14 of file LSLearnerItemTest.php.

◆ LP_STATUS

const LSLearnerItemTest::LP_STATUS = 2

Definition at line 18 of file LSLearnerItemTest.php.

Referenced by testCreate().

◆ ORDER_NUMBER

const LSLearnerItemTest::ORDER_NUMBER = 10

Definition at line 15 of file LSLearnerItemTest.php.

◆ REF_ID

const LSLearnerItemTest::REF_ID = 30

Definition at line 16 of file LSLearnerItemTest.php.

◆ TITLE

const LSLearnerItemTest::TITLE = "tile"

Definition at line 11 of file LSLearnerItemTest.php.

◆ TYPE

const LSLearnerItemTest::TYPE = "type"

Definition at line 10 of file LSLearnerItemTest.php.

◆ USER_ID

const LSLearnerItemTest::USER_ID = 6

Definition at line 17 of file LSLearnerItemTest.php.


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