ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables 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 ()
 
 testExamples ()
 
 testJsonSerialize ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $entry
 
 $entry_data
 

Detailed Description

Definition at line 12 of file ComponentEntryTest.php.

Member Function Documentation

◆ setUp()

ComponentEntryTest::setUp ( )
protected

Definition at line 24 of file ComponentEntryTest.php.

24  : void
25  {
26  $this->entry_data = include "tests/UI/Crawler/Fixture/EntryFixture.php";
27  $this->entry = new Entry($this->entry_data);
28  }

◆ testChildren()

ComponentEntryTest::testChildren ( )

Definition at line 143 of file ComponentEntryTest.php.

144  {
145  $this->assertEquals($this->entry_data["children"], $this->entry->getChildren());
146  $this->entry->setChildren([]);
147  $this->assertEquals([], $this->entry->getChildren());
148  $this->entry->addChildren(
149  array(
150  0 => 'Child1',
151  1 => 'Child2'
152  )
153  );
154  $this->assertEquals(['Child1','Child2'], $this->entry->getChildren());
155  $this->entry->addChild('Child3');
156  $this->assertEquals(['Child1','Child2','Child3'], $this->entry->getChildren());
157  }

◆ testConstruct()

ComponentEntryTest::testConstruct ( )

Definition at line 31 of file ComponentEntryTest.php.

32  {
33  $this->assertInstanceOf(Entry::class, $this->entry);
34  }

◆ testContext()

ComponentEntryTest::testContext ( )

Definition at line 91 of file ComponentEntryTest.php.

92  {
93  $this->assertEquals($this->entry_data["context"], $this->entry->getContext());
94  $this->entry->setContext([]);
95  $this->assertEquals([], $this->entry->getContext());
96  }

◆ testExamples()

ComponentEntryTest::testExamples ( )

Definition at line 161 of file ComponentEntryTest.php.

162  {
163  $this->assertEquals('src/UI/Factory/Entry1Title', $this->entry->getExamplesPath());
164  }

◆ testFeatureWikiReferences()

ComponentEntryTest::testFeatureWikiReferences ( )

Definition at line 98 of file ComponentEntryTest.php.

99  {
100  $this->assertEquals($this->entry_data["feature_wiki_references"], $this->entry->getFeatureWikiReferences());
101  $this->entry->setFeatureWikiReferences([]);
102  $this->assertEquals([], $this->entry->getFeatureWikiReferences());
103  }

◆ testGetId()

ComponentEntryTest::testGetId ( )

Definition at line 36 of file ComponentEntryTest.php.

37  {
38  $this->assertEquals($this->entry_data["id"], $this->entry->getId());
39  $this->entry->setId("newId");
40  $this->assertEquals("newId", $this->entry->getId());
41  }

◆ testGetTitle()

ComponentEntryTest::testGetTitle ( )

Definition at line 43 of file ComponentEntryTest.php.

44  {
45  $this->assertEquals($this->entry_data["title"], $this->entry->getTitle());
46  $this->entry->setTitle("newTitle");
47  $this->assertEquals("newTitle", $this->entry->getTitle());
48  }

◆ testIsAbstract()

ComponentEntryTest::testIsAbstract ( )

Definition at line 50 of file ComponentEntryTest.php.

51  {
52  $this->assertEquals($this->entry_data["abstract"], $this->entry->isAbstract());
53  $this->entry->setIsAbstract(false);
54  $this->assertEquals(false, $this->entry->isAbstract());
55  }

◆ testJsonSerialize()

ComponentEntryTest::testJsonSerialize ( )

Definition at line 167 of file ComponentEntryTest.php.

168  {
169  $this->assertEquals(include "tests/UI/Crawler/Fixture/EntryFixture.php", $this->entry->jsonSerialize());
170  }

◆ testLessVariables()

ComponentEntryTest::testLessVariables ( )

Definition at line 120 of file ComponentEntryTest.php.

121  {
122  $this->assertEquals($this->entry_data["less_variables"], $this->entry->getLessVariables());
123  $this->entry->setLessVariables([]);
124  $this->assertEquals([], $this->entry->getLessVariables());
125  }

◆ testParent()

ComponentEntryTest::testParent ( )

Definition at line 134 of file ComponentEntryTest.php.

135  {
136  $this->assertEquals($this->entry_data["parent"], $this->entry->getParent());
137  $this->entry->setParent("test");
138  $this->assertEquals("test", $this->entry->getParent());
139  $this->entry->setParent(false);
140  $this->assertEquals(false, $this->entry->getParent());
141  }

◆ testPath()

ComponentEntryTest::testPath ( )

Definition at line 127 of file ComponentEntryTest.php.

128  {
129  $this->assertEquals($this->entry_data["path"], $this->entry->getPath());
130  $this->entry->setPath("");
131  $this->assertEquals("", $this->entry->getPath());
132  }

◆ testRules()

ComponentEntryTest::testRules ( )

Definition at line 105 of file ComponentEntryTest.php.

106  {
107  $this->assertEquals(new Rules($this->entry_data["rules"]), $this->entry->getRules());
108  $this->assertEquals($this->entry_data["rules"], $this->entry->getRulesAsArray());
109  $this->entry->setRules(new Rules([]));
110  $this->assertEquals(new Rules([]), $this->entry->getRules());
111  }

◆ testSelector()

ComponentEntryTest::testSelector ( )

Definition at line 113 of file ComponentEntryTest.php.

114  {
115  $this->assertEquals($this->entry_data["selector"], $this->entry->getSelector());
116  $this->entry->setSelector("otherSelector");
117  $this->assertEquals("otherSelector", $this->entry->getSelector());
118  }

◆ testSetBackground()

ComponentEntryTest::testSetBackground ( )

Definition at line 84 of file ComponentEntryTest.php.

85  {
86  $this->assertEquals($this->entry_data["background"], $this->entry->getBackground());
87  $this->entry->setBackground("someBackground");
88  $this->assertEquals("someBackground", $this->entry->getBackground());
89  }

◆ testSetDescription()

ComponentEntryTest::testSetDescription ( )

Definition at line 71 of file ComponentEntryTest.php.

72  {
73  $this->assertEquals(new Description($this->entry_data["description"]), $this->entry->getDescription());
74  $this->assertEquals($this->entry_data["description"], $this->entry->getDescriptionAsArray());
75  $this->entry->setDescription(new Description([]));
76  $this->assertEquals(new Description([]), $this->entry->getDescription());
77  $this->assertEquals(array(
78  'purpose' => '',
79  'composition' => '',
80  'effect' => '',
81  'rivals' => array()), $this->entry->getDescriptionAsArray());
82  }

◆ testStatusEntry()

ComponentEntryTest::testStatusEntry ( )

Definition at line 57 of file ComponentEntryTest.php.

58  {
59  $this->assertEquals($this->entry_data["status_entry"], $this->entry->getStatusEntry());
60  $this->entry->setStatusEntry("someStatus");
61  $this->assertEquals("someStatus", $this->entry->getStatusEntry());
62  }

◆ testStatusImplementation()

ComponentEntryTest::testStatusImplementation ( )

Definition at line 64 of file ComponentEntryTest.php.

65  {
66  $this->assertEquals($this->entry_data["status_implementation"], $this->entry->getStatusImplementation());
67  $this->entry->setStatusImplementation("someStatus");
68  $this->assertEquals("someStatus", $this->entry->getStatusImplementation());
69  }

Field Documentation

◆ $entry

ComponentEntryTest::$entry
protected

Definition at line 17 of file ComponentEntryTest.php.

◆ $entry_data

ComponentEntryTest::$entry_data
protected

Definition at line 22 of file ComponentEntryTest.php.


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