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));
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));
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));
90 $first = new \DOMElement(
'first');
91 $firstSubject =
new Subject($first, $this->nestingLimit);
92 self::assertSame(0, $firstSubject->countUsedIn());
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());
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());
threeLevelsCountUsedInIsCorrect()
<first> <second> <third> <third> <third> </second> <second> <third> <third> <third> </second> </first...
oneLevelCountsUseIsCorrect()
<first></first>
threeLevelsCountUseIsCorrect()
<first> <second> <third> <third> <third> </second> <second> <third> <third> <third> </second> </first...
oneLevelCountsUsedInIsCorrect()
<first> </first>
twoLevelsCountUsedInIsCorrect()
<first> <second> <second> </first>
twoLevelsCountUseIsCorrect()
<first> <second> <second> </first>