ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ComponentEntryTest Class Reference
+ Inheritance diagram for ComponentEntryTest:
+ Collaboration diagram for ComponentEntryTest:

Public Member Functions

 testConstruct ()
 
 testGetId ()
 
 testGetTitle ()
 
 testIsAbstract ()
 
 testStatusEntry ()
 
 testStatusImplementation ()
 
 testSetDescription ()
 
 testSetBackground ()
 
 testContext ()
 
 testFeatureWikiReferences ()
 
 testRules ()
 
 testSelector ()
 
 testLessVariables ()
 
 testPath ()
 
 testParent ()
 
 testChildren ()
 
 testExamplePath ()
 
 testExamplesNull ()
 
 testJsonSerialize ()
 
 testNamespace ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

Entry $entry
 
array $entry_data
 

Detailed Description

Definition at line 29 of file ComponentEntryTest.php.

Member Function Documentation

◆ setUp()

ComponentEntryTest::setUp ( )
protected

Definition at line 34 of file ComponentEntryTest.php.

34  : void
35  {
36  $this->entry_data = include "components/ILIAS/UI/tests/Crawler/Fixture/EntryFixture.php";
37  $this->entry = new Entry($this->entry_data);
38  }

◆ testChildren()

ComponentEntryTest::testChildren ( )

Definition at line 151 of file ComponentEntryTest.php.

151  : void
152  {
153  $this->assertEquals($this->entry_data["children"], $this->entry->getChildren());
154  $this->entry->setChildren([]);
155  $this->assertEquals([], $this->entry->getChildren());
156  $this->entry->addChildren(
157  array(
158  0 => 'Child1',
159  1 => 'Child2'
160  )
161  );
162  $this->assertEquals(['Child1','Child2'], $this->entry->getChildren());
163  $this->entry->addChild('Child3');
164  $this->assertEquals(['Child1','Child2','Child3'], $this->entry->getChildren());
165  }

◆ testConstruct()

ComponentEntryTest::testConstruct ( )

Definition at line 41 of file ComponentEntryTest.php.

41  : void
42  {
43  $this->assertInstanceOf(Entry::class, $this->entry);
44  }

◆ testContext()

ComponentEntryTest::testContext ( )

Definition at line 101 of file ComponentEntryTest.php.

101  : void
102  {
103  $this->assertEquals($this->entry_data["context"], $this->entry->getContext());
104  $this->entry->setContext([]);
105  $this->assertEquals([], $this->entry->getContext());
106  }

◆ testExamplePath()

ComponentEntryTest::testExamplePath ( )

Definition at line 167 of file ComponentEntryTest.php.

167  : void
168  {
169  $this->assertEquals('components/ILIAS/UI/src/examples/Entry1Title', $this->entry->getExamplesPath());
170  }

◆ testExamplesNull()

ComponentEntryTest::testExamplesNull ( )

Definition at line 172 of file ComponentEntryTest.php.

172  : void
173  {
174  $this->assertEquals([], $this->entry->getExamples());
175  }

◆ testFeatureWikiReferences()

ComponentEntryTest::testFeatureWikiReferences ( )

Definition at line 108 of file ComponentEntryTest.php.

108  : void
109  {
110  $this->assertEquals($this->entry_data["feature_wiki_references"], $this->entry->getFeatureWikiReferences());
111  $this->entry->setFeatureWikiReferences([]);
112  $this->assertEquals([], $this->entry->getFeatureWikiReferences());
113  }

◆ testGetId()

ComponentEntryTest::testGetId ( )

Definition at line 46 of file ComponentEntryTest.php.

46  : void
47  {
48  $this->assertEquals($this->entry_data["id"], $this->entry->getId());
49  $this->entry->setId("newId");
50  $this->assertEquals("newId", $this->entry->getId());
51  }

◆ testGetTitle()

ComponentEntryTest::testGetTitle ( )

Definition at line 53 of file ComponentEntryTest.php.

53  : void
54  {
55  $this->assertEquals($this->entry_data["title"], $this->entry->getTitle());
56  $this->entry->setTitle("newTitle");
57  $this->assertEquals("newTitle", $this->entry->getTitle());
58  }

◆ testIsAbstract()

ComponentEntryTest::testIsAbstract ( )

Definition at line 60 of file ComponentEntryTest.php.

60  : void
61  {
62  $this->assertEquals($this->entry_data["abstract"], $this->entry->isAbstract());
63  $this->entry->setIsAbstract(false);
64  $this->assertEquals(false, $this->entry->isAbstract());
65  }

◆ testJsonSerialize()

ComponentEntryTest::testJsonSerialize ( )

Definition at line 177 of file ComponentEntryTest.php.

177  : void
178  {
179  $this->assertEquals(include "components/ILIAS/UI/tests/Crawler/Fixture/EntryFixture.php", $this->entry->jsonSerialize());
180  }

◆ testLessVariables()

ComponentEntryTest::testLessVariables ( )

Definition at line 130 of file ComponentEntryTest.php.

130  : void
131  {
132  $this->assertEquals($this->entry_data["less_variables"], $this->entry->getLessVariables());
133  $this->entry->setLessVariables([]);
134  $this->assertEquals([], $this->entry->getLessVariables());
135  }

◆ testNamespace()

ComponentEntryTest::testNamespace ( )

Definition at line 182 of file ComponentEntryTest.php.

182  : void
183  {
184  $this->assertEquals($this->entry_data["namespace"], $this->entry->getNamespace());
185  $this->entry->setNamespace("");
186  $this->assertEquals("", $this->entry->getNamespace());
187  }

◆ testParent()

ComponentEntryTest::testParent ( )

Definition at line 144 of file ComponentEntryTest.php.

144  : void
145  {
146  $this->assertEquals($this->entry_data["parent"], $this->entry->getParent());
147  $this->entry->setParent("test");
148  $this->assertEquals("test", $this->entry->getParent());
149  }

◆ testPath()

ComponentEntryTest::testPath ( )

Definition at line 137 of file ComponentEntryTest.php.

137  : void
138  {
139  $this->assertEquals($this->entry_data["path"], $this->entry->getPath());
140  $this->entry->setPath("");
141  $this->assertEquals("", $this->entry->getPath());
142  }

◆ testRules()

ComponentEntryTest::testRules ( )

Definition at line 115 of file ComponentEntryTest.php.

115  : void
116  {
117  $this->assertEquals(new Rules($this->entry_data["rules"]), $this->entry->getRules());
118  $this->assertEquals($this->entry_data["rules"], $this->entry->getRulesAsArray());
119  $this->entry->setRules(new Rules([]));
120  $this->assertEquals(new Rules([]), $this->entry->getRules());
121  }

◆ testSelector()

ComponentEntryTest::testSelector ( )

Definition at line 123 of file ComponentEntryTest.php.

123  : void
124  {
125  $this->assertEquals($this->entry_data["selector"], $this->entry->getSelector());
126  $this->entry->setSelector("otherSelector");
127  $this->assertEquals("otherSelector", $this->entry->getSelector());
128  }

◆ testSetBackground()

ComponentEntryTest::testSetBackground ( )

Definition at line 94 of file ComponentEntryTest.php.

94  : void
95  {
96  $this->assertEquals($this->entry_data["background"], $this->entry->getBackground());
97  $this->entry->setBackground("someBackground");
98  $this->assertEquals("someBackground", $this->entry->getBackground());
99  }

◆ testSetDescription()

ComponentEntryTest::testSetDescription ( )

Definition at line 81 of file ComponentEntryTest.php.

81  : void
82  {
83  $this->assertEquals(new Description($this->entry_data["description"]), $this->entry->getDescription());
84  $this->assertEquals($this->entry_data["description"], $this->entry->getDescriptionAsArray());
85  $this->entry->setDescription(new Description([]));
86  $this->assertEquals(new Description([]), $this->entry->getDescription());
87  $this->assertEquals(array(
88  'purpose' => '',
89  'composition' => '',
90  'effect' => '',
91  'rivals' => array()), $this->entry->getDescriptionAsArray());
92  }

◆ testStatusEntry()

ComponentEntryTest::testStatusEntry ( )

Definition at line 67 of file ComponentEntryTest.php.

67  : void
68  {
69  $this->assertEquals($this->entry_data["status_entry"], $this->entry->getStatusEntry());
70  $this->entry->setStatusEntry("someStatus");
71  $this->assertEquals("someStatus", $this->entry->getStatusEntry());
72  }

◆ testStatusImplementation()

ComponentEntryTest::testStatusImplementation ( )

Definition at line 74 of file ComponentEntryTest.php.

74  : void
75  {
76  $this->assertEquals($this->entry_data["status_implementation"], $this->entry->getStatusImplementation());
77  $this->entry->setStatusImplementation("someStatus");
78  $this->assertEquals("someStatus", $this->entry->getStatusImplementation());
79  }

Field Documentation

◆ $entry

Entry ComponentEntryTest::$entry
protected

Definition at line 31 of file ComponentEntryTest.php.

◆ $entry_data

array ComponentEntryTest::$entry_data
protected

Definition at line 32 of file ComponentEntryTest.php.


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