ILIAS  release_8 Revision v8.24
LSItemTest Class Reference
+ Inheritance diagram for LSItemTest:
+ Collaboration diagram for LSItemTest:

Public Member Functions

 testCreate ()
 
 testWithOnline (LSItem $object)
 @depends testCreate More...
 
 testWithOrderNumber (LSItem $object)
 @depends testCreate More...
 
 testWithPostCondition (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 Member Functions

 setUp ()
 

Protected Attributes

ilLSPostCondition $post_condition
 

Detailed Description

Definition at line 23 of file LSItemTest.php.

Member Function Documentation

◆ setUp()

LSItemTest::setUp ( )
protected

Definition at line 35 of file LSItemTest.php.

35 : void
36 {
37 $this->post_condition = new ilLSPostCondition(666, 'always');
38 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ testCreate()

LSItemTest::testCreate ( )

Definition at line 40 of file LSItemTest.php.

40 : LSItem
41 {
42 $object = new LSItem(
43 self::TYPE,
44 self::TITLE,
45 self::DESC,
46 self::ICON_PATH,
47 self::IS_ONLINE,
48 self::ORDER_NUMBER,
49 $this->post_condition,
50 self::REF_ID
51 );
52
53 $this->assertEquals(self::TYPE, $object->getType());
54 $this->assertEquals(self::TITLE, $object->getTitle());
55 $this->assertEquals(self::DESC, $object->getDescription());
56 $this->assertEquals(self::ICON_PATH, $object->getIconPath());
57 $this->assertEquals(self::IS_ONLINE, $object->isOnline());
58 $this->assertEquals(self::ORDER_NUMBER, $object->getOrderNumber());
59 $this->assertEquals($object->getPostCondition(), $this->post_condition);
60 $this->assertEquals(self::REF_ID, $object->getRefId());
61
62 return $object;
63 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: LSItem.php:25

◆ testWithOnline()

LSItemTest::testWithOnline ( LSItem  $object)

@depends testCreate

Definition at line 68 of file LSItemTest.php.

68 : void
69 {
70 $new_obj = $object->withOnline(false);
71
72 $this->assertEquals(self::TYPE, $object->getType());
73 $this->assertEquals(self::TITLE, $object->getTitle());
74 $this->assertEquals(self::DESC, $object->getDescription());
75 $this->assertEquals(self::ICON_PATH, $object->getIconPath());
76 $this->assertEquals(self::IS_ONLINE, $object->isOnline());
77 $this->assertEquals(self::ORDER_NUMBER, $object->getOrderNumber());
78 $this->assertEquals($object->getPostCondition(), $this->post_condition);
79 $this->assertEquals(self::REF_ID, $object->getRefId());
80
81 $this->assertEquals(self::TYPE, $new_obj->getType());
82 $this->assertEquals(self::TITLE, $new_obj->getTitle());
83 $this->assertEquals(self::DESC, $new_obj->getDescription());
84 $this->assertEquals(self::ICON_PATH, $new_obj->getIconPath());
85 $this->assertEquals(false, $new_obj->isOnline());
86 $this->assertEquals(self::ORDER_NUMBER, $new_obj->getOrderNumber());
87 $this->assertEquals($new_obj->getPostCondition(), $this->post_condition);
88 $this->assertEquals(self::REF_ID, $new_obj->getRefId());
89 }
getRefId()
Definition: LSItem.php:90
getIconPath()
Definition: LSItem.php:70
getOrderNumber()
Definition: LSItem.php:80
getType()
Definition: LSItem.php:55
getDescription()
Definition: LSItem.php:65
getTitle()
Definition: LSItem.php:60
withOnline(bool $online)
Definition: LSItem.php:95
getPostCondition()
Definition: LSItem.php:85
isOnline()
Definition: LSItem.php:75

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 94 of file LSItemTest.php.

94 : void
95 {
96 $new_obj = $object->withOrderNumber(20);
97
98 $this->assertEquals(self::TYPE, $object->getType());
99 $this->assertEquals(self::TITLE, $object->getTitle());
100 $this->assertEquals(self::DESC, $object->getDescription());
101 $this->assertEquals(self::ICON_PATH, $object->getIconPath());
102 $this->assertEquals(self::IS_ONLINE, $object->isOnline());
103 $this->assertEquals(self::ORDER_NUMBER, $object->getOrderNumber());
104 $this->assertEquals($object->getPostCondition(), $this->post_condition);
105 $this->assertEquals(self::REF_ID, $object->getRefId());
106
107 $this->assertEquals(self::TYPE, $new_obj->getType());
108 $this->assertEquals(self::TITLE, $new_obj->getTitle());
109 $this->assertEquals(self::DESC, $new_obj->getDescription());
110 $this->assertEquals(self::ICON_PATH, $new_obj->getIconPath());
111 $this->assertEquals(self::IS_ONLINE, $new_obj->isOnline());
112 $this->assertEquals(20, $new_obj->getOrderNumber());
113 $this->assertEquals($new_obj->getPostCondition(), $this->post_condition);
114 $this->assertEquals(self::REF_ID, $new_obj->getRefId());
115 }
withOrderNumber(int $order_number)
Definition: LSItem.php:102

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 120 of file LSItemTest.php.

120 : void
121 {
122 $pc = new ilLSPostCondition(555, 'always');
123 $new_obj = $object->withPostCondition($pc);
124
125 $this->assertEquals(self::TYPE, $object->getType());
126 $this->assertEquals(self::TITLE, $object->getTitle());
127 $this->assertEquals(self::DESC, $object->getDescription());
128 $this->assertEquals(self::ICON_PATH, $object->getIconPath());
129 $this->assertEquals(self::IS_ONLINE, $object->isOnline());
130 $this->assertEquals(self::ORDER_NUMBER, $object->getOrderNumber());
131 $this->assertEquals($object->getPostCondition(), $this->post_condition);
132 $this->assertEquals(self::REF_ID, $object->getRefId());
133
134 $this->assertEquals(self::TYPE, $new_obj->getType());
135 $this->assertEquals(self::TITLE, $new_obj->getTitle());
136 $this->assertEquals(self::DESC, $new_obj->getDescription());
137 $this->assertEquals(self::ICON_PATH, $new_obj->getIconPath());
138 $this->assertEquals(self::IS_ONLINE, $new_obj->isOnline());
139 $this->assertEquals(self::ORDER_NUMBER, $new_obj->getOrderNumber());
140 $this->assertEquals($new_obj->getPostCondition(), $pc);
141 $this->assertEquals(self::REF_ID, $new_obj->getRefId());
142 }
withPostCondition(ilLSPostCondition $post_condition)
Definition: LSItem.php:109

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:

Field Documentation

◆ $post_condition

ilLSPostCondition LSItemTest::$post_condition
protected

Definition at line 33 of file LSItemTest.php.

◆ DESC

const LSItemTest::DESC = "description"

Definition at line 27 of file LSItemTest.php.

◆ ICON_PATH

const LSItemTest::ICON_PATH = "icon_path"

Definition at line 28 of file LSItemTest.php.

◆ IS_ONLINE

const LSItemTest::IS_ONLINE = true

Definition at line 29 of file LSItemTest.php.

◆ ORDER_NUMBER

const LSItemTest::ORDER_NUMBER = 10

Definition at line 30 of file LSItemTest.php.

◆ REF_ID

const LSItemTest::REF_ID = 30

Definition at line 31 of file LSItemTest.php.

◆ TITLE

const LSItemTest::TITLE = "tile"

Definition at line 26 of file LSItemTest.php.

◆ TYPE

const LSItemTest::TYPE = "type"

Definition at line 25 of file LSItemTest.php.


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