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

References $post_condition.

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:11

◆ testWithOnline()

LSItemTest::testWithOnline ( LSItem  $object)

testCreate

Definition at line 55 of file LSItemTest.php.

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

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  }
getTitle()
Definition: LSItem.php:78
getOrderNumber()
Definition: LSItem.php:105
getPostCondition()
Definition: LSItem.php:117
getDescription()
Definition: LSItem.php:83
getRefId()
Definition: LSItem.php:129
getIconPath()
Definition: LSItem.php:88
isOnline()
Definition: LSItem.php:93
withOnline(bool $online)
Definition: LSItem.php:98
getType()
Definition: LSItem.php:73
+ Here is the call graph for this function:

◆ testWithOrderNumber()

LSItemTest::testWithOrderNumber ( LSItem  $object)

testCreate

Definition at line 81 of file LSItemTest.php.

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

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  }
getTitle()
Definition: LSItem.php:78
getOrderNumber()
Definition: LSItem.php:105
getPostCondition()
Definition: LSItem.php:117
getDescription()
Definition: LSItem.php:83
getRefId()
Definition: LSItem.php:129
withOrderNumber(int $order_number)
Definition: LSItem.php:110
getIconPath()
Definition: LSItem.php:88
isOnline()
Definition: LSItem.php:93
getType()
Definition: LSItem.php:73
+ Here is the call graph for this function:

◆ testWithPostCondition()

LSItemTest::testWithPostCondition ( LSItem  $object)

testCreate

Definition at line 107 of file LSItemTest.php.

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

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  }
getTitle()
Definition: LSItem.php:78
getOrderNumber()
Definition: LSItem.php:105
getPostCondition()
Definition: LSItem.php:117
getDescription()
Definition: LSItem.php:83
getRefId()
Definition: LSItem.php:129
getIconPath()
Definition: LSItem.php:88
isOnline()
Definition: LSItem.php:93
A PostCondition does restrict the progression of a user through the learning sequence.
withPostCondition(ilLSPostCondition $postcondition)
Definition: LSItem.php:122
getType()
Definition: LSItem.php:73
+ Here is the call graph for this function:

◆ testWrongValueInWithOnline()

LSItemTest::testWrongValueInWithOnline ( LSItem  $object)

testCreate

Definition at line 134 of file LSItemTest.php.

References LSItem\withOnline().

135  {
136  $this->expectException(TypeError::class);
137  $object->withOnline("wrong_value");
138  }
withOnline(bool $online)
Definition: LSItem.php:98
+ Here is the call graph for this function:

◆ testWrongValueInWithOrderNumber()

LSItemTest::testWrongValueInWithOrderNumber ( LSItem  $object)

testCreate

Definition at line 143 of file LSItemTest.php.

References LSItem\withOrderNumber().

144  {
145  $this->expectException(TypeError::class);
146  $object->withOrderNumber("wrong_value");
147  }
withOrderNumber(int $order_number)
Definition: LSItem.php:110
+ Here is the call graph for this function:

◆ testWrongValueInWithPostCondition()

LSItemTest::testWrongValueInWithPostCondition ( LSItem  $object)

testCreate

Definition at line 152 of file LSItemTest.php.

References LSItem\withPostCondition().

153  {
154  $this->expectException(TypeError::class);
155  $object->withPostCondition("wrong_value");
156  }
withPostCondition(ilLSPostCondition $postcondition)
Definition: LSItem.php:122
+ Here is the call graph for this function:

Field Documentation

◆ $post_condition

LSItemTest::$post_condition
protected

◆ 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: