1515use B13 \Container \Tests \Acceptance \Support \BackendTester ;
1616use B13 \Container \Tests \Acceptance \Support \PageTree ;
1717use B13 \Container \Tests \Acceptance \Support \PageTreeV13 ;
18- use TYPO3 \CMS \Core \Information \Typo3Version ;
19- use TYPO3 \CMS \Core \Utility \GeneralUtility ;
2018
2119class ContentDefenderCest
2220{
@@ -34,7 +32,7 @@ public function _before(BackendTester $I)
3432 public function canCreateChildIn2ColsContainerWithNoContentDefenderRestrictionsDefined (BackendTester $ I , PageTree $ pageTree , PageTreeV13 $ pageTreeV13 ): void
3533 {
3634 $ I ->clickLayoutModuleButton ();
37- if (GeneralUtility:: makeInstance (Typo3Version::class)-> getMajorVersion () < 13 ) {
35+ if ($ I -> getTypo3MajorVersion () < 13 ) {
3836 $ I ->waitForElement ('#typo3-pagetree-tree .nodes .node ' );
3937 $ pageTree ->openPath (['home ' , 'pageWithDifferentContainers ' ]);
4038 } else {
@@ -47,7 +45,7 @@ public function canCreateChildIn2ColsContainerWithNoContentDefenderRestrictionsD
4745 $ I ->clickNewContentElement ($ colPosSelector );
4846 $ I ->switchToIFrame ();
4947 $ I ->waitForModal ();
50- if (GeneralUtility:: makeInstance (Typo3Version::class)-> getMajorVersion () > 12 ) {
48+ if ($ I -> getTypo3MajorVersion () > 12 ) {
5149 $ I ->executeJS ("document.querySelector(' " . $ I ->getNewRecordWizardSelector () . "').shadowRoot.querySelector('button[data-identifier= \"default \"]').click() " );
5250 }
5351 $ I ->waitForText ('Header Only ' );
@@ -61,7 +59,7 @@ public function canCreateChildIn2ColsContainerWithNoContentDefenderRestrictionsD
6159 public function doNotSeeNotAllowedContentElementsInNewContentElementWizard (BackendTester $ I , PageTree $ pageTree , PageTreeV13 $ pageTreeV13 ): void
6260 {
6361 $ I ->clickLayoutModuleButton ();
64- if (GeneralUtility:: makeInstance (Typo3Version::class)-> getMajorVersion () < 13 ) {
62+ if ($ I -> getTypo3MajorVersion () < 13 ) {
6563 $ I ->waitForElement ('#typo3-pagetree-tree .nodes .node ' );
6664 $ pageTree ->openPath (['home ' , 'pageWithContainer-3 ' ]);
6765 } else {
@@ -74,7 +72,7 @@ public function doNotSeeNotAllowedContentElementsInNewContentElementWizard(Backe
7472 $ I ->clickNewContentElement ($ colPosSelector );
7573 $ I ->switchToIFrame ();
7674 $ I ->waitForModal ();
77- if (GeneralUtility:: makeInstance (Typo3Version::class)-> getMajorVersion () > 12 ) {
75+ if ($ I -> getTypo3MajorVersion () > 12 ) {
7876 $ I ->executeJS ("document.querySelector(' " . $ I ->getNewRecordWizardSelector () . "').shadowRoot.querySelector('button[data-identifier= \"default \"]').click() " );
7977 }
8078 $ I ->waitForText ('Header Only ' );
@@ -87,23 +85,22 @@ public function doNotSeeNotAllowedContentElementsInNewContentElementWizard(Backe
8785 public function doNotSeeNotAllowedContentElementsInNewContentElementWizardTriggeredByContextMenu (BackendTester $ I , PageTree $ pageTree , PageTreeV13 $ pageTreeV13 ): void
8886 {
8987 $ I ->clickLayoutModuleButton ();
90- if (GeneralUtility:: makeInstance (Typo3Version::class)-> getMajorVersion () < 13 ) {
88+ if ($ I -> getTypo3MajorVersion () < 13 ) {
9189 $ I ->waitForElement ('#typo3-pagetree-tree .nodes .node ' );
9290 $ pageTree ->openPath (['home ' , 'pageWithContainer-3 ' ]);
9391 } else {
9492 $ pageTreeV13 ->openPath (['home ' , 'pageWithContainer-3 ' ]);
9593 }
9694 $ I ->wait (0.5 );
9795 $ I ->switchToContentFrame ();
98- $ typo3Version = GeneralUtility::makeInstance (Typo3Version::class);
99- if ($ typo3Version ->getMajorVersion () < 12 ) {
96+ if ($ I ->getTypo3MajorVersion () < 12 ) {
10097 $ I ->waitForElement ('#element-tt_content-810 a.t3js-contextmenutrigger ' );
10198 $ I ->click ('#element-tt_content-810 a.t3js-contextmenutrigger ' );
10299 } else {
103100 $ I ->waitForElement ('#element-tt_content-800 [data-contextmenu-uid="810"] ' );
104101 $ I ->click ('#element-tt_content-800 [data-contextmenu-uid="810"] ' );
105102 }
106- switch ($ typo3Version -> getMajorVersion ()) {
103+ switch ($ I -> getTypo3MajorVersion ()) {
107104 case 11 :
108105 $ I ->waitForText ('More options... ' );
109106 $ I ->click ('.list-group-item-submenu ' );
@@ -128,7 +125,7 @@ public function doNotSeeNotAllowedContentElementsInNewContentElementWizardTrigge
128125
129126 $ I ->switchToIFrame ();
130127 $ I ->waitForModal ();
131- if (GeneralUtility:: makeInstance (Typo3Version::class)-> getMajorVersion () > 12 ) {
128+ if ($ I -> getTypo3MajorVersion () > 12 ) {
132129 $ I ->executeJS ("document.querySelector(' " . $ I ->getNewRecordWizardSelector () . "').shadowRoot.querySelector('button[data-identifier= \"default \"]').click() " );
133130 }
134131 $ I ->waitForText ('Header Only ' );
@@ -141,7 +138,7 @@ public function doNotSeeNotAllowedContentElementsInNewContentElementWizardTrigge
141138 public function doNotSeeNotAllowedContentElementsInCTypeSelectBoxWhenCreateNewElement (BackendTester $ I , PageTree $ pageTree , PageTreeV13 $ pageTreeV13 )
142139 {
143140 $ I ->clickLayoutModuleButton ();
144- if (GeneralUtility:: makeInstance (Typo3Version::class)-> getMajorVersion () < 13 ) {
141+ if ($ I -> getTypo3MajorVersion () < 13 ) {
145142 $ I ->waitForElement ('#typo3-pagetree-tree .nodes .node ' );
146143 $ pageTree ->openPath (['home ' , 'pageWithContainer-4 ' ]);
147144 } else {
@@ -154,15 +151,14 @@ public function doNotSeeNotAllowedContentElementsInCTypeSelectBoxWhenCreateNewEl
154151 $ I ->clickNewContentElement ($ colPosSelector );
155152 $ I ->switchToIFrame ();
156153 $ I ->waitForModal ();
157- if (GeneralUtility:: makeInstance (Typo3Version::class)-> getMajorVersion () > 12 ) {
154+ if ($ I -> getTypo3MajorVersion () > 12 ) {
158155 $ I ->executeJS ("document.querySelector(' " . $ I ->getNewRecordWizardSelector () . "').shadowRoot.querySelector('button[data-identifier= \"default \"]').click() " );
159156 }
160157 $ I ->waitForText ('Header Only ' );
161- $ typo3Version = GeneralUtility::makeInstance (Typo3Version::class);
162- if ($ typo3Version ->getMajorVersion () < 12 ) {
158+ if ($ I ->getTypo3MajorVersion () < 12 ) {
163159 $ I ->click ('Header Only ' );
164160 } else {
165- if ($ typo3Version -> getMajorVersion () < 13 ) {
161+ if ($ I -> getTypo3MajorVersion () < 13 ) {
166162 $ I ->executeJS ("document.querySelector(' " . $ I ->getNewRecordWizardSelector () . "').shadowRoot.querySelector('button[data-identifier= \"common_header \"]').click() " );
167163 } else {
168164 $ I ->executeJS ("document.querySelector(' " . $ I ->getNewRecordWizardSelector () . "').shadowRoot.querySelector('button[data-identifier= \"default_header \"]').click() " );
@@ -180,7 +176,7 @@ public function doNotSeeNotAllowedContentElementsInCTypeSelectBoxWhenCreateNewEl
180176 public function doNotSeeNotAllowedContentElementsInCTypeSelectBoxWhenEditAnElement (BackendTester $ I , PageTree $ pageTree , PageTreeV13 $ pageTreeV13 )
181177 {
182178 $ I ->clickLayoutModuleButton ();
183- if (GeneralUtility:: makeInstance (Typo3Version::class)-> getMajorVersion () < 13 ) {
179+ if ($ I -> getTypo3MajorVersion () < 13 ) {
184180 $ I ->waitForElement ('#typo3-pagetree-tree .nodes .node ' );
185181 $ pageTree ->openPath (['home ' , 'contentTCASelectCtype ' ]);
186182 } else {
@@ -201,7 +197,7 @@ public function doNotSeeNotAllowedContentElementsInCTypeSelectBoxWhenEditAnEleme
201197 public function canSeeNewContentButtonIfMaxitemsIsNotReached (BackendTester $ I , PageTree $ pageTree , PageTreeV13 $ pageTreeV13 )
202198 {
203199 $ I ->clickLayoutModuleButton ();
204- if (GeneralUtility:: makeInstance (Typo3Version::class)-> getMajorVersion () < 13 ) {
200+ if ($ I -> getTypo3MajorVersion () < 13 ) {
205201 $ I ->waitForElement ('#typo3-pagetree-tree .nodes .node ' );
206202 $ pageTree ->openPath (['home ' , 'contentDefenderMaxitems ' ]);
207203 } else {
@@ -220,7 +216,7 @@ public function canSeeNewContentButtonIfMaxitemsIsNotReached(BackendTester $I, P
220216 public function canNotSeeNewContentButtonIfMaxitemsIsReached (BackendTester $ I , PageTree $ pageTree , PageTreeV13 $ pageTreeV13 )
221217 {
222218 $ I ->clickLayoutModuleButton ();
223- if (GeneralUtility:: makeInstance (Typo3Version::class)-> getMajorVersion () < 13 ) {
219+ if ($ I -> getTypo3MajorVersion () < 13 ) {
224220 $ I ->waitForElement ('#typo3-pagetree-tree .nodes .node ' );
225221 $ pageTree ->openPath (['home ' , 'contentDefenderMaxitems ' ]);
226222 } else {
@@ -240,7 +236,7 @@ public function canNotSeeNewContentButtonIfMaxitemsIsReached(BackendTester $I, P
240236 public function canCreateNewChildInContainerIfMaxitemsIsReachedInOtherContainer (BackendTester $ I , PageTree $ pageTree , PageTreeV13 $ pageTreeV13 )
241237 {
242238 $ I ->clickLayoutModuleButton ();
243- if (GeneralUtility:: makeInstance (Typo3Version::class)-> getMajorVersion () < 13 ) {
239+ if ($ I -> getTypo3MajorVersion () < 13 ) {
244240 $ I ->waitForElement ('#typo3-pagetree-tree .nodes .node ' );
245241 $ pageTree ->openPath (['home ' , 'contentDefenderMaxitems ' ]);
246242 } else {
@@ -253,15 +249,14 @@ public function canCreateNewChildInContainerIfMaxitemsIsReachedInOtherContainer(
253249 $ I ->clickNewContentElement ($ colPosSelector );
254250 $ I ->switchToIFrame ();
255251 $ I ->waitForModal ();
256- if (GeneralUtility:: makeInstance (Typo3Version::class)-> getMajorVersion () > 12 ) {
252+ if ($ I -> getTypo3MajorVersion () > 12 ) {
257253 $ I ->executeJS ("document.querySelector(' " . $ I ->getNewRecordWizardSelector () . "').shadowRoot.querySelector('button[data-identifier= \"default \"]').click() " );
258254 }
259255 $ I ->waitForText ('Header Only ' );
260- $ typo3Version = GeneralUtility::makeInstance (Typo3Version::class);
261- if ($ typo3Version ->getMajorVersion () < 12 ) {
256+ if ($ I ->getTypo3MajorVersion () < 12 ) {
262257 $ I ->click ('Header Only ' );
263258 } else {
264- if ($ typo3Version -> getMajorVersion () < 13 ) {
259+ if ($ I -> getTypo3MajorVersion () < 13 ) {
265260 $ I ->executeJS ("document.querySelector(' " . $ I ->getNewRecordWizardSelector () . "').shadowRoot.querySelector('button[data-identifier= \"common_header \"]').click() " );
266261 } else {
267262 $ I ->executeJS ("document.querySelector(' " . $ I ->getNewRecordWizardSelector () . "').shadowRoot.querySelector('button[data-identifier= \"default_header \"]').click() " );
@@ -278,7 +273,7 @@ public function canCreateNewChildInContainerIfMaxitemsIsReachedInOtherContainer(
278273 public function seeEditDocumentWhenAddingChildrenToColposWhereOnlyHeaderIsAllowed (BackendTester $ I , PageTree $ pageTree , PageTreeV13 $ pageTreeV13 )
279274 {
280275 $ I ->clickLayoutModuleButton ();
281- if (GeneralUtility:: makeInstance (Typo3Version::class)-> getMajorVersion () < 13 ) {
276+ if ($ I -> getTypo3MajorVersion () < 13 ) {
282277 $ I ->waitForElement ('#typo3-pagetree-tree .nodes .node ' );
283278 $ pageTree ->openPath (['home ' , 'pageWithDifferentContainers ' ]);
284279 } else {
0 commit comments