ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
enshrined\svgSanitize\Tests\SubjectTest Class Reference

Class SubjectTest. More...

+ Inheritance diagram for enshrined\svgSanitize\Tests\SubjectTest:
+ Collaboration diagram for enshrined\svgSanitize\Tests\SubjectTest:

Public Member Functions

 oneLevelCountsUseIsCorrect ()
 <first></first> More...
 
 twoLevelsCountUseIsCorrect ()
 <first> <second> <second> </first> More...
 
 threeLevelsCountUseIsCorrect ()
 <first> <second> <third> <third> <third> </second> <second> <third> <third> <third> </second> </first> More...
 
 oneLevelCountsUsedInIsCorrect ()
 <first> </first> More...
 
 twoLevelsCountUsedInIsCorrect ()
 <first> <second> <second> </first> More...
 
 threeLevelsCountUsedInIsCorrect ()
 <first> <second> <third> <third> <third> </second> <second> <third> <third> <third> </second> </first> More...
 

Protected Attributes

 $nestingLimit = 15
 

Detailed Description

Class SubjectTest.

Definition at line 10 of file SubjectTest.php.

Member Function Documentation

◆ oneLevelCountsUsedInIsCorrect()

enshrined\svgSanitize\Tests\SubjectTest::oneLevelCountsUsedInIsCorrect ( )

<first> </first>

Test:

Definition at line 88 of file SubjectTest.php.

89  {
90  $first = new \DOMElement('first');
91  $firstSubject = new Subject($first, $this->nestingLimit);
92  self::assertSame(0, $firstSubject->countUsedIn());
93  }

◆ oneLevelCountsUseIsCorrect()

enshrined\svgSanitize\Tests\SubjectTest::oneLevelCountsUseIsCorrect ( )

<first></first>

Test:

Definition at line 21 of file SubjectTest.php.

22  {
23  $first = new \DOMElement('first');
24  $firstSubject = new Subject($first, $this->nestingLimit);
25  self::assertSame(0, $firstSubject->countUse(false));
26  self::assertSame(0, $firstSubject->countUse(true));
27  }

◆ threeLevelsCountUsedInIsCorrect()

enshrined\svgSanitize\Tests\SubjectTest::threeLevelsCountUsedInIsCorrect ( )

<first> <second> <third> <third> <third> </second> <second> <third> <third> <third> </second> </first>

Test:

Definition at line 130 of file SubjectTest.php.

131  {
132  $first = new \DOMElement('first');
133  $second = new \DOMElement('second');
134  $third = new \DOMElement('third');
135  $firstSubject = new Subject($first, $this->nestingLimit);
136  $secondSubject = new Subject($second, $this->nestingLimit);
137  $thirdSubject = new Subject($third, $this->nestingLimit);
138  $thirdSubject->addUsedIn($secondSubject);
139  $thirdSubject->addUsedIn($secondSubject);
140  $thirdSubject->addUsedIn($secondSubject);
141  $secondSubject->addUsedIn($firstSubject);
142  $secondSubject->addUsedIn($firstSubject);
143  self::assertSame(6, $thirdSubject->countUsedIn());
144  }

◆ threeLevelsCountUseIsCorrect()

enshrined\svgSanitize\Tests\SubjectTest::threeLevelsCountUseIsCorrect ( )

<first> <second> <third> <third> <third> </second> <second> <third> <third> <third> </second> </first>

Test:

Definition at line 65 of file SubjectTest.php.

66  {
67  $first = new \DOMElement('first');
68  $second = new \DOMElement('second');
69  $third = new \DOMElement('third');
70  $firstSubject = new Subject($first, $this->nestingLimit);
71  $secondSubject = new Subject($second, $this->nestingLimit);
72  $thirdSubject = new Subject($third, $this->nestingLimit);
73  $firstSubject->addUse($secondSubject);
74  $firstSubject->addUse($secondSubject);
75  $secondSubject->addUse($thirdSubject);
76  $secondSubject->addUse($thirdSubject);
77  $secondSubject->addUse($thirdSubject);
78  self::assertSame(6, $firstSubject->countUse(false));
79  self::assertSame(8, $firstSubject->countUse(true));
80  }

◆ twoLevelsCountUsedInIsCorrect()

enshrined\svgSanitize\Tests\SubjectTest::twoLevelsCountUsedInIsCorrect ( )

<first> <second> <second> </first>

Test:

Definition at line 103 of file SubjectTest.php.

104  {
105  $first = new \DOMElement('first');
106  $second = new \DOMElement('second');
107  $firstSubject = new Subject($first, $this->nestingLimit);
108  $secondSubject = new Subject($second, $this->nestingLimit);
109  $secondSubject->addUsedIn($firstSubject);
110  $secondSubject->addUsedIn($firstSubject);
111  self::assertSame(2, $secondSubject->countUsedIn());
112  }

◆ twoLevelsCountUseIsCorrect()

enshrined\svgSanitize\Tests\SubjectTest::twoLevelsCountUseIsCorrect ( )

<first> <second> <second> </first>

Test:

Definition at line 37 of file SubjectTest.php.

38  {
39  $first = new \DOMElement('first');
40  $second = new \DOMElement('second');
41  $firstSubject = new Subject($first, $this->nestingLimit);
42  $secondSubject = new Subject($second, $this->nestingLimit);
43  $firstSubject->addUse($secondSubject);
44  $firstSubject->addUse($secondSubject);
45  self::assertSame(2, $firstSubject->countUse(false));
46  self::assertSame(2, $firstSubject->countUse(true));
47  }

Field Documentation

◆ $nestingLimit

enshrined\svgSanitize\Tests\SubjectTest::$nestingLimit = 15
protected

Definition at line 12 of file SubjectTest.php.


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