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

Public Member Functions

 setUp ()
 
 testCreate ()
 
 testWithOnline (LSItem $object)
 @depends testCreate More...
 
 testWithOrderNumber (LSItem $object)
 @depends testCreate More...
 
 testWithPostCondition (LSItem $object)
 @depends testCreate More...
 
 testWrongValueInWithOnline (LSItem $object)
 @depends testCreate More...
 
 testWrongValueInWithOrderNumber (LSItem $object)
 @depends testCreate More...
 
 testWrongValueInWithPostCondition (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
 

Protected Attributes

 $post_condition
 

Detailed Description

Definition at line 7 of file LSItemTest.php.

Member Function Documentation

◆ setUp()

LSItemTest::setUp ( )

Definition at line 22 of file LSItemTest.php.

23 {
24 $this->post_condition = new ilLSPostCondition(666, 'op');
25 }
A PostCondition does restrict the progression of a user through the learning sequence.

◆ testCreate()

LSItemTest::testCreate ( )

Definition at line 27 of file LSItemTest.php.

27 : LSItem
28 {
29 $object = new LSItem(
30 self::TYPE,
31 self::TITLE,
32 self::DESC,
33 self::ICON_PATH,
34 self::IS_ONLINE,
35 self::ORDER_NUMBER,
36 $this->post_condition,
37 self::REF_ID
38 );
39
40 $this->assertEquals($object->getType(), self::TYPE);
41 $this->assertEquals($object->getTitle(), self::TITLE);
42 $this->assertEquals($object->getDescription(), self::DESC);
43 $this->assertEquals($object->getIconPath(), self::ICON_PATH);
44 $this->assertEquals($object->isOnline(), self::IS_ONLINE);
45 $this->assertEquals($object->getOrderNumber(), self::ORDER_NUMBER);
46 $this->assertEquals($object->getPostCondition(), $this->post_condition);
47 $this->assertEquals($object->getRefId(), self::REF_ID);
48
49 return $object;
50 }
Data holding class LSItem .
Definition: LSItem.php:12

◆ testWithOnline()

LSItemTest::testWithOnline ( LSItem  $object)

@depends testCreate

Definition at line 55 of file LSItemTest.php.

56 {
57 $new_obj = $object->withOnline(false);
58
59 $this->assertEquals($object->getType(), self::TYPE);
60 $this->assertEquals($object->getTitle(), self::TITLE);
61 $this->assertEquals($object->getDescription(), self::DESC);
62 $this->assertEquals($object->getIconPath(), self::ICON_PATH);
63 $this->assertEquals($object->isOnline(), self::IS_ONLINE);
64 $this->assertEquals($object->getOrderNumber(), self::ORDER_NUMBER);
65 $this->assertEquals($object->getPostCondition(), $this->post_condition);
66 $this->assertEquals($object->getRefId(), self::REF_ID);
67
68 $this->assertEquals($new_obj->getType(), self::TYPE);
69 $this->assertEquals($new_obj->getTitle(), self::TITLE);
70 $this->assertEquals($new_obj->getDescription(), self::DESC);
71 $this->assertEquals($new_obj->getIconPath(), self::ICON_PATH);
72 $this->assertEquals($new_obj->isOnline(), false);
73 $this->assertEquals($new_obj->getOrderNumber(), self::ORDER_NUMBER);
74 $this->assertEquals($new_obj->getPostCondition(), $this->post_condition);
75 $this->assertEquals($new_obj->getRefId(), self::REF_ID);
76 }
getRefId()
Definition: LSItem.php:129
getIconPath()
Definition: LSItem.php:88
getOrderNumber()
Definition: LSItem.php:105
getType()
Definition: LSItem.php:73
getDescription()
Definition: LSItem.php:83
getTitle()
Definition: LSItem.php:78
withOnline(bool $online)
Definition: LSItem.php:98
getPostCondition()
Definition: LSItem.php:117
isOnline()
Definition: LSItem.php:93

References LSItem\getDescription(), LSItem\getIconPath(), LSItem\getOrderNumber(), LSItem\getPostCondition(), LSItem\getRefId(), LSItem\getTitle(), LSItem\getType(), LSItem\isOnline(), and LSItem\withOnline().

+ Here is the call graph for this function:

◆ testWithOrderNumber()

LSItemTest::testWithOrderNumber ( LSItem  $object)

@depends testCreate

Definition at line 81 of file LSItemTest.php.

82 {
83 $new_obj = $object->withOrderNumber(20);
84
85 $this->assertEquals($object->getType(), self::TYPE);
86 $this->assertEquals($object->getTitle(), self::TITLE);
87 $this->assertEquals($object->getDescription(), self::DESC);
88 $this->assertEquals($object->getIconPath(), self::ICON_PATH);
89 $this->assertEquals($object->isOnline(), self::IS_ONLINE);
90 $this->assertEquals($object->getOrderNumber(), self::ORDER_NUMBER);
91 $this->assertEquals($object->getPostCondition(), $this->post_condition);
92 $this->assertEquals($object->getRefId(), self::REF_ID);
93
94 $this->assertEquals($new_obj->getType(), self::TYPE);
95 $this->assertEquals($new_obj->getTitle(), self::TITLE);
96 $this->assertEquals($new_obj->getDescription(), self::DESC);
97 $this->assertEquals($new_obj->getIconPath(), self::ICON_PATH);
98 $this->assertEquals($new_obj->isOnline(), self::IS_ONLINE);
99 $this->assertEquals($new_obj->getOrderNumber(), 20);
100 $this->assertEquals($new_obj->getPostCondition(), $this->post_condition);
101 $this->assertEquals($new_obj->getRefId(), self::REF_ID);
102 }
withOrderNumber(int $order_number)
Definition: LSItem.php:110

References LSItem\getDescription(), LSItem\getIconPath(), LSItem\getOrderNumber(), LSItem\getPostCondition(), LSItem\getRefId(), LSItem\getTitle(), LSItem\getType(), LSItem\isOnline(), and LSItem\withOrderNumber().

+ Here is the call graph for this function:

◆ testWithPostCondition()

LSItemTest::testWithPostCondition ( LSItem  $object)

@depends testCreate

Definition at line 107 of file LSItemTest.php.

108 {
109 $pc = new ilLSPostCondition(555, "2");
110 $new_obj = $object->withPostCondition($pc);
111
112 $this->assertEquals($object->getType(), self::TYPE);
113 $this->assertEquals($object->getTitle(), self::TITLE);
114 $this->assertEquals($object->getDescription(), self::DESC);
115 $this->assertEquals($object->getIconPath(), self::ICON_PATH);
116 $this->assertEquals($object->isOnline(), self::IS_ONLINE);
117 $this->assertEquals($object->getOrderNumber(), self::ORDER_NUMBER);
118 $this->assertEquals($object->getPostCondition(), $this->post_condition);
119 $this->assertEquals($object->getRefId(), self::REF_ID);
120
121 $this->assertEquals($new_obj->getType(), self::TYPE);
122 $this->assertEquals($new_obj->getTitle(), self::TITLE);
123 $this->assertEquals($new_obj->getDescription(), self::DESC);
124 $this->assertEquals($new_obj->getIconPath(), self::ICON_PATH);
125 $this->assertEquals($new_obj->isOnline(), self::IS_ONLINE);
126 $this->assertEquals($new_obj->getOrderNumber(), self::ORDER_NUMBER);
127 $this->assertEquals($new_obj->getPostCondition(), $pc);
128 $this->assertEquals($new_obj->getRefId(), self::REF_ID);
129 }
withPostCondition(ilLSPostCondition $postcondition)
Definition: LSItem.php:122

References LSItem\getDescription(), LSItem\getIconPath(), LSItem\getOrderNumber(), LSItem\getPostCondition(), LSItem\getRefId(), LSItem\getTitle(), LSItem\getType(), LSItem\isOnline(), and LSItem\withPostCondition().

+ Here is the call graph for this function:

◆ testWrongValueInWithOnline()

LSItemTest::testWrongValueInWithOnline ( LSItem  $object)

@depends testCreate

Definition at line 134 of file LSItemTest.php.

135 {
136 $this->expectException(TypeError::class);
137 $object->withOnline("wrong_value");
138 }

References LSItem\withOnline().

+ Here is the call graph for this function:

◆ testWrongValueInWithOrderNumber()

LSItemTest::testWrongValueInWithOrderNumber ( LSItem  $object)

@depends testCreate

Definition at line 143 of file LSItemTest.php.

144 {
145 $this->expectException(TypeError::class);
146 $object->withOrderNumber("wrong_value");
147 }

References LSItem\withOrderNumber().

+ Here is the call graph for this function:

◆ testWrongValueInWithPostCondition()

LSItemTest::testWrongValueInWithPostCondition ( LSItem  $object)

@depends testCreate

Definition at line 152 of file LSItemTest.php.

153 {
154 $this->expectException(TypeError::class);
155 $object->withPostCondition("wrong_value");
156 }

References LSItem\withPostCondition().

+ Here is the call graph for this function:

Field Documentation

◆ $post_condition

LSItemTest::$post_condition
protected

Definition at line 20 of file LSItemTest.php.

◆ DESC

const LSItemTest::DESC = "description"

Definition at line 11 of file LSItemTest.php.

◆ ICON_PATH

const LSItemTest::ICON_PATH = "icon_path"

Definition at line 12 of file LSItemTest.php.

◆ IS_ONLINE

const LSItemTest::IS_ONLINE = true

Definition at line 13 of file LSItemTest.php.

◆ ORDER_NUMBER

const LSItemTest::ORDER_NUMBER = 10

Definition at line 14 of file LSItemTest.php.

◆ REF_ID

const LSItemTest::REF_ID = 30

Definition at line 15 of file LSItemTest.php.

◆ TITLE

const LSItemTest::TITLE = "tile"

Definition at line 10 of file LSItemTest.php.

◆ TYPE

const LSItemTest::TYPE = "type"

Definition at line 9 of file LSItemTest.php.


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