[BUGFIX] Add missing namespace parts
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Tests / Unit / Configuration / TypoScript / ConditionMatching / ConditionMatcherTest.php
1 <?php
2 namespace TYPO3\CMS\Frontend\Tests\Unit\Configuration\TypoScript\ConditionMatching;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Core\Configuration\TypoScript\Exception\InvalidTypoScriptConditionException;
18 use TYPO3\CMS\Core\Utility\GeneralUtility;
19 use TYPO3\CMS\Frontend\Configuration\TypoScript\ConditionMatching\ConditionMatcher;
20 use TYPO3\CMS\Frontend\Tests\Unit\Configuration\TypoScript\ConditionMatching\Fixtures\TestConditionException;
21
22 /**
23 * Test case
24 */
25 class ConditionMatcherTest extends \TYPO3\Components\TestingFramework\Core\Unit\UnitTestCase
26 {
27 /**
28 * @var string Name of a key in $GLOBALS for this test
29 */
30 protected $testGlobalNamespace;
31
32 /**
33 * @var \TYPO3\CMS\Frontend\Configuration\TypoScript\ConditionMatching\ConditionMatcher Class under test
34 */
35 protected $matchCondition;
36
37 protected function setUp()
38 {
39 $this->testGlobalNamespace = $this->getUniqueId('TEST');
40 GeneralUtility::flushInternalRuntimeCaches();
41 $GLOBALS[$this->testGlobalNamespace] = [];
42 $GLOBALS['TSFE'] = new \stdClass();
43 $GLOBALS['TSFE']->tmpl = new \stdClass();
44 $GLOBALS['TSFE']->tmpl->rootLine = [
45 2 => ['uid' => 121, 'pid' => 111],
46 1 => ['uid' => 111, 'pid' => 101],
47 0 => ['uid' => 101, 'pid' => 0]
48 ];
49 $this->matchCondition = GeneralUtility::makeInstance(ConditionMatcher::class);
50 }
51
52 /**
53 * Tests whether a faulty expression fails.
54 *
55 * @test
56 */
57 public function simulateDisabledMatchAllConditionsFailsOnFaultyExpression()
58 {
59 $this->matchCondition->matchAll = false;
60 $this->assertFalse($this->matchCondition->match('[nullCondition = This expression would return FALSE in general]'));
61 }
62
63 /**
64 * Tests whether simulating positive matches for all conditions succeeds.
65 *
66 * @test
67 */
68 public function simulateEnabledMatchAllConditionsSucceeds()
69 {
70 $this->matchCondition->setSimulateMatchResult(true);
71 $this->assertTrue($this->matchCondition->match('[nullCondition = This expression would return FALSE in general]'));
72 }
73
74 /**
75 * Tests whether simulating positive matches for specific conditions succeeds.
76 *
77 * @test
78 */
79 public function simulateEnabledMatchSpecificConditionsSucceeds()
80 {
81 $testCondition = '[' . $this->getUniqueId('test') . ' = Any condition to simulate a positive match]';
82 $this->matchCondition->setSimulateMatchConditions([$testCondition]);
83 $this->assertTrue($this->matchCondition->match($testCondition));
84 }
85
86 /**
87 * Tests whether the language comparison matches.
88 *
89 * @test
90 */
91 public function languageConditionMatchesSingleLanguageExpression()
92 {
93 $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3';
94 $this->assertTrue($this->matchCondition->match('[language = *de*]'));
95 $this->assertTrue($this->matchCondition->match('[language = *de-de*]'));
96 }
97
98 /**
99 * Tests whether the language comparison matches.
100 *
101 * @test
102 */
103 public function languageConditionMatchesMultipleLanguagesExpression()
104 {
105 $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3';
106 $this->assertTrue($this->matchCondition->match('[language = *en*,*de*]'));
107 $this->assertTrue($this->matchCondition->match('[language = *en-us*,*de-de*]'));
108 }
109
110 /**
111 * Tests whether the language comparison matches.
112 *
113 * @test
114 */
115 public function languageConditionMatchesCompleteLanguagesExpression()
116 {
117 $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3';
118 $this->assertTrue($this->matchCondition->match('[language = de-de,de;q=0.8,en-us;q=0.5,en;q=0.3]'));
119 }
120
121 /**
122 * Tests whether usergroup comparison matches.
123 *
124 * @test
125 */
126 public function usergroupConditionMatchesSingleGroupId()
127 {
128 $GLOBALS['TSFE']->gr_list = '13,14,15';
129 $this->assertTrue($this->matchCondition->match('[usergroup = 13]'));
130 }
131
132 /**
133 * Tests whether usergroup comparison matches.
134 *
135 * @test
136 */
137 public function usergroupConditionMatchesMultipleUserGroupId()
138 {
139 $GLOBALS['TSFE']->gr_list = '13,14,15';
140 $this->assertTrue($this->matchCondition->match('[usergroup = 999,15,14,13]'));
141 }
142
143 /**
144 * Tests whether usergroup comparison matches.
145 *
146 * @test
147 */
148 public function usergroupConditionDoesNotMatchDefaulUserGroupIds()
149 {
150 $GLOBALS['TSFE']->gr_list = '0,-1';
151 $this->assertFalse($this->matchCondition->match('[usergroup = 0,-1]'));
152 }
153
154 /**
155 * Tests whether user comparison matches.
156 *
157 * @test
158 */
159 public function loginUserConditionMatchesAnyLoggedInUser()
160 {
161 $GLOBALS['TSFE']->loginUser = true;
162 $GLOBALS['TSFE']->fe_user->user['uid'] = 13;
163 $this->assertTrue($this->matchCondition->match('[loginUser = *]'));
164 }
165
166 /**
167 * Tests whether user comparison matches.
168 *
169 * @test
170 */
171 public function loginUserConditionMatchesSingleLoggedInUser()
172 {
173 $GLOBALS['TSFE']->loginUser = true;
174 $GLOBALS['TSFE']->fe_user->user['uid'] = 13;
175 $this->assertTrue($this->matchCondition->match('[loginUser = 13]'));
176 }
177
178 /**
179 * Tests whether user comparison matches.
180 *
181 * @test
182 */
183 public function loginUserConditionMatchesMultipleLoggedInUsers()
184 {
185 $GLOBALS['TSFE']->loginUser = true;
186 $GLOBALS['TSFE']->fe_user->user['uid'] = 13;
187 $this->assertTrue($this->matchCondition->match('[loginUser = 999,13]'));
188 }
189
190 /**
191 * Tests whether user comparison matches.
192 *
193 * @test
194 */
195 public function loginUserConditionDoesNotMatchIfNotUserIsLoggedId()
196 {
197 $GLOBALS['TSFE']->loginUser = false;
198 $GLOBALS['TSFE']->fe_user->user['uid'] = 13;
199 $this->assertFalse($this->matchCondition->match('[loginUser = *]'));
200 $this->assertFalse($this->matchCondition->match('[loginUser = 13]'));
201 }
202
203 /**
204 * Tests whether user is not logged in
205 *
206 * @test
207 */
208 public function loginUserConditionMatchIfUserIsNotLoggedIn()
209 {
210 $GLOBALS['TSFE']->loginUser = false;
211 $this->assertTrue($this->matchCondition->match('[loginUser = ]'));
212 }
213
214 /**
215 * Tests whether numerical comparison matches.
216 *
217 * @test
218 */
219 public function globalVarConditionMatchesOnEqualExpression()
220 {
221 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 = 10]'));
222 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 = 10.1]'));
223 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 == 10]'));
224 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 == 10.1]'));
225 }
226
227 /**
228 * Tests whether numerical comparison matches.
229 *
230 * @test
231 */
232 public function globalVarConditionMatchesOnEqualExpressionWithMultipleValues()
233 {
234 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 = 10|20|30]'));
235 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 = 10.1|20.2|30.3]'));
236 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:20 = 10|20|30]'));
237 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:20.2 = 10.1|20.2|30.3]'));
238 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 == 10|20|30]'));
239 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 == 10.1|20.2|30.3]'));
240 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:20 == 10|20|30]'));
241 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:20.2 == 10.1|20.2|30.3]'));
242 }
243
244 /**
245 * Tests whether numerical comparison matches.
246 *
247 * @test
248 */
249 public function globalVarConditionMatchesOnNotEqualExpression()
250 {
251 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 != 20]'));
252 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 != 10.2]'));
253 }
254
255 /**
256 * Tests whether numerical comparison does not match.
257 *
258 * @test
259 */
260 public function globalVarConditionDoesNotMatchOnNotEqualExpression()
261 {
262 $this->assertFalse($this->matchCondition->match('[globalVar = LIT:10 != 10]'));
263 }
264
265 /**
266 * Tests whether numerical comparison matches.
267 *
268 * @test
269 */
270 public function globalVarConditionMatchesOnNotEqualExpressionWithMultipleValues()
271 {
272 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 != 20|30]'));
273 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 != 10.2|20.3]'));
274 }
275
276 /**
277 * Tests whether numerical comparison matches.
278 *
279 * @test
280 */
281 public function globalVarConditionMatchesOnLowerThanExpression()
282 {
283 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 < 20]'));
284 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 < 10.2]'));
285 }
286
287 /**
288 * Tests whether numerical comparison matches.
289 *
290 * @test
291 */
292 public function globalVarConditionMatchesOnLowerThanOrEqualExpression()
293 {
294 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 <= 10]'));
295 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 <= 20]'));
296 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 <= 10.1]'));
297 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 <= 10.2]'));
298 }
299
300 /**
301 * Tests whether numerical comparison matches.
302 *
303 * @test
304 */
305 public function globalVarConditionMatchesOnGreaterThanExpression()
306 {
307 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:20 > 10]'));
308 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.2 > 10.1]'));
309 }
310
311 /**
312 * Tests whether numerical comparison matches.
313 *
314 * @test
315 */
316 public function globalVarConditionMatchesOnGreaterThanOrEqualExpression()
317 {
318 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 >= 10]'));
319 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:20 >= 10]'));
320 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 >= 10.1]'));
321 $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.2 >= 10.1]'));
322 }
323
324 /**
325 * Tests whether numerical comparison matches.
326 *
327 * @test
328 */
329 public function globalVarConditionMatchesOnEmptyExpressionWithNoValueSet()
330 {
331 $testKey = $this->getUniqueId('test');
332 $this->assertTrue($this->matchCondition->match('[globalVar = GP:' . $testKey . '=]'));
333 $this->assertTrue($this->matchCondition->match('[globalVar = GP:' . $testKey . ' = ]'));
334 }
335
336 /**
337 * Tests whether numerical comparison matches.
338 *
339 * @test
340 */
341 public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero()
342 {
343 $testKey = $this->getUniqueId('test');
344 $_GET = [];
345 $_POST = [$testKey => 0];
346 $this->assertFalse($this->matchCondition->match('[globalVar = GP:' . $testKey . '=]'));
347 $this->assertFalse($this->matchCondition->match('[globalVar = GP:' . $testKey . ' = ]'));
348 }
349
350 /**
351 * Tests whether an array with zero as key matches its value
352 *
353 * @test
354 */
355 public function globalVarConditionMatchesOnArrayExpressionWithZeroAsKey()
356 {
357 $testKey = $this->getUniqueId('test');
358 $testValue = '1';
359 $_GET = [];
360 $_POST = [$testKey => ['0' => $testValue]];
361 $this->assertTrue($this->matchCondition->match('[globalVar = GP:' . $testKey . '|0=' . $testValue . ']'));
362 }
363
364 /**
365 * Tests whether string comparison matches.
366 *
367 * @test
368 */
369 public function globalStringConditionMatchesOnEqualExpression()
370 {
371 $this->assertTrue($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = TYPO3.Test.Condition]'));
372 $this->assertFalse($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = TYPO3]'));
373 }
374
375 /**
376 * Tests whether string comparison matches.
377 *
378 * @test
379 */
380 public function globalStringConditionMatchesOnEmptyExpressionWithValueSetToEmptyString()
381 {
382 $testKey = $this->getUniqueId('test');
383 $_GET = [];
384 $_POST = [$testKey => ''];
385 $this->assertTrue($this->matchCondition->match('[globalString = GP:' . $testKey . '=]'));
386 $this->assertTrue($this->matchCondition->match('[globalString = GP:' . $testKey . ' = ]'));
387 }
388
389 /**
390 * Tests whether string comparison matches.
391 *
392 * @test
393 */
394 public function globalStringConditionMatchesOnEmptyLiteralExpressionWithValueSetToEmptyString()
395 {
396 $this->assertTrue($this->matchCondition->match('[globalString = LIT:=]'));
397 $this->assertTrue($this->matchCondition->match('[globalString = LIT: = ]'));
398 }
399
400 /**
401 * Tests whether string comparison matches.
402 *
403 * @test
404 */
405 public function globalStringConditionMatchesWildcardExpression()
406 {
407 $this->assertTrue($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = TYPO3?Test?Condition]'));
408 $this->assertTrue($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = TYPO3.T*t.Condition]'));
409 $this->assertTrue($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = TYPO3?T*t?Condition]'));
410 }
411
412 /**
413 * Tests whether string comparison matches.
414 *
415 * @test
416 */
417 public function globalStringConditionMatchesRegularExpression()
418 {
419 $this->assertTrue($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = /^[A-Za-z3.]+$/]'));
420 $this->assertTrue($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = /^TYPO3\\..+Condition$/]'));
421 $this->assertFalse($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = /^FALSE/]'));
422 }
423
424 /**
425 * Tests whether string comparison matches.
426 *
427 * @test
428 */
429 public function globalStringConditionMatchesEmptyRegularExpression()
430 {
431 $testKey = $this->getUniqueId('test');
432 $_SERVER[$testKey] = '';
433 $this->assertTrue($this->matchCondition->match('[globalString = _SERVER|' . $testKey . ' = /^$/]'));
434 }
435
436 /**
437 * Tests whether treeLevel comparison matches.
438 *
439 * @test
440 */
441 public function treeLevelConditionMatchesSingleValue()
442 {
443 $this->assertTrue($this->matchCondition->match('[treeLevel = 2]'));
444 }
445
446 /**
447 * Tests whether treeLevel comparison matches.
448 *
449 * @test
450 */
451 public function treeLevelConditionMatchesMultipleValues()
452 {
453 $this->assertTrue($this->matchCondition->match('[treeLevel = 999,998,2]'));
454 }
455
456 /**
457 * Tests whether treeLevel comparison matches.
458 *
459 * @test
460 */
461 public function treeLevelConditionDoesNotMatchFaultyValue()
462 {
463 $this->assertFalse($this->matchCondition->match('[treeLevel = 999]'));
464 }
465
466 /**
467 * Tests whether a page Id is found in the previous rootline entries.
468 *
469 * @test
470 */
471 public function PIDupinRootlineConditionMatchesSinglePageIdInRootline()
472 {
473 $GLOBALS['TSFE']->id = 121;
474 $this->assertTrue($this->matchCondition->match('[PIDupinRootline = 111]'));
475 }
476
477 /**
478 * Tests whether a page Id is found in the previous rootline entries.
479 *
480 * @test
481 */
482 public function PIDupinRootlineConditionMatchesMultiplePageIdsInRootline()
483 {
484 $GLOBALS['TSFE']->id = 121;
485 $this->assertTrue($this->matchCondition->match('[PIDupinRootline = 999,111,101]'));
486 }
487
488 /**
489 * Tests whether a page Id is found in the previous rootline entries.
490 *
491 * @test
492 */
493 public function PIDupinRootlineConditionDoesNotMatchPageIdNotInRootline()
494 {
495 $GLOBALS['TSFE']->id = 121;
496 $this->assertFalse($this->matchCondition->match('[PIDupinRootline = 999]'));
497 }
498
499 /**
500 * Tests whether a page Id is found in the previous rootline entries.
501 *
502 * @test
503 */
504 public function PIDupinRootlineConditionDoesNotMatchLastPageIdInRootline()
505 {
506 $GLOBALS['TSFE']->id = 121;
507 $this->assertFalse($this->matchCondition->match('[PIDupinRootline = 121]'));
508 }
509
510 /**
511 * Tests whether a page Id is found in all rootline entries.
512 *
513 * @test
514 */
515 public function PIDinRootlineConditionMatchesSinglePageIdInRootline()
516 {
517 $GLOBALS['TSFE']->id = 121;
518 $this->assertTrue($this->matchCondition->match('[PIDinRootline = 111]'));
519 }
520
521 /**
522 * Tests whether a page Id is found in all rootline entries.
523 *
524 * @test
525 */
526 public function PIDinRootlineConditionMatchesMultiplePageIdsInRootline()
527 {
528 $GLOBALS['TSFE']->id = 121;
529 $this->assertTrue($this->matchCondition->match('[PIDinRootline = 999,111,101]'));
530 }
531
532 /**
533 * Tests whether a page Id is found in all rootline entries.
534 *
535 * @test
536 */
537 public function PIDinRootlineConditionMatchesLastPageIdInRootline()
538 {
539 $GLOBALS['TSFE']->id = 121;
540 $this->assertTrue($this->matchCondition->match('[PIDinRootline = 121]'));
541 }
542
543 /**
544 * Tests whether a page Id is found in all rootline entries.
545 *
546 * @test
547 */
548 public function PIDinRootlineConditionDoesNotMatchPageIdNotInRootline()
549 {
550 $GLOBALS['TSFE']->id = 121;
551 $this->assertFalse($this->matchCondition->match('[PIDinRootline = 999]'));
552 }
553
554 /**
555 * Tests whether the compatibility version can be evaluated.
556 * (e.g. 7.9 is compatible to 7.0 but not to 15.0)
557 *
558 * @test
559 */
560 public function compatVersionConditionMatchesOlderRelease()
561 {
562 $this->assertTrue($this->matchCondition->match('[compatVersion = 7.0]'));
563 }
564
565 /**
566 * Tests whether the compatibility version can be evaluated.
567 * (e.g. 7.9 is compatible to 7.0 but not to 15.0)
568 *
569 * @test
570 */
571 public function compatVersionConditionMatchesSameRelease()
572 {
573 $this->assertTrue($this->matchCondition->match('[compatVersion = ' . TYPO3_branch . ']'));
574 }
575
576 /**
577 * Tests whether the compatibility version can be evaluated.
578 * (e.g. 7.9 is compatible to 7.0 but not to 15.0)
579 *
580 * @test
581 */
582 public function compatVersionConditionDoesNotMatchNewerRelease()
583 {
584 $this->assertFalse($this->matchCondition->match('[compatVersion = 15.0]'));
585 }
586
587 /**
588 * Tests whether the generic fetching of variables works with the namespace 'GP'.
589 *
590 * @test
591 */
592 public function genericGetVariablesSucceedsWithNamespaceGP()
593 {
594 $_GET = ['testGet' => 'getTest'];
595 $_POST = ['testPost' => 'postTest'];
596 $this->assertTrue($this->matchCondition->match('[globalString = GP:testGet = getTest]'));
597 $this->assertTrue($this->matchCondition->match('[globalString = GP:testPost = postTest]'));
598 }
599
600 /**
601 * Tests whether the generic fetching of variables works with the namespace 'TSFE'.
602 *
603 * @test
604 */
605 public function genericGetVariablesSucceedsWithNamespaceTSFE()
606 {
607 $GLOBALS['TSFE']->id = 1234567;
608 $GLOBALS['TSFE']->testSimpleObject = new \stdClass();
609 $GLOBALS['TSFE']->testSimpleObject->testSimpleVariable = 'testValue';
610 $this->assertTrue($this->matchCondition->match('[globalString = TSFE:id = 1234567]'));
611 $this->assertTrue($this->matchCondition->match('[globalString = TSFE:testSimpleObject|testSimpleVariable = testValue]'));
612 }
613
614 /**
615 * Tests whether the generic fetching of variables works with the namespace 'ENV'.
616 *
617 * @test
618 */
619 public function genericGetVariablesSucceedsWithNamespaceENV()
620 {
621 $testKey = $this->getUniqueId('test');
622 putenv($testKey . '=testValue');
623 $this->assertTrue($this->matchCondition->match('[globalString = ENV:' . $testKey . ' = testValue]'));
624 }
625
626 /**
627 * Tests whether the generic fetching of variables works with the namespace 'IENV'.
628 *
629 * @test
630 */
631 public function genericGetVariablesSucceedsWithNamespaceIENV()
632 {
633 $_SERVER['HTTP_HOST'] = GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY') . ':1234567';
634 $this->assertTrue($this->matchCondition->match('[globalString = IENV:TYPO3_PORT = 1234567]'));
635 }
636
637 /**
638 * Tests whether the generic fetching of variables works with any global namespace.
639 *
640 * @test
641 */
642 public function genericGetVariablesSucceedsWithAnyGlobalNamespace()
643 {
644 $GLOBALS[$this->testGlobalNamespace] = [
645 'first' => 'testFirst',
646 'second' => ['third' => 'testThird']
647 ];
648 $this->assertTrue($this->matchCondition->match('[globalString = ' . $this->testGlobalNamespace . '|first = testFirst]'));
649 $this->assertTrue($this->matchCondition->match('[globalString = ' . $this->testGlobalNamespace . '|second|third = testThird]'));
650 }
651
652 /**
653 * @test
654 */
655 public function matchThrowsExceptionIfConditionClassDoesNotInheritFromAbstractCondition()
656 {
657 $this->expectException(InvalidTypoScriptConditionException::class);
658 $this->expectExceptionCode(1410286153);
659 $this->matchCondition->match('[stdClass = foo]');
660 }
661
662 /**
663 * @test
664 */
665 public function matchCallsTestConditionAndHandsOverParameters()
666 {
667 $this->expectException(TestConditionException::class);
668 $this->expectExceptionCode(1411581139);
669 $this->matchCondition->match('[TYPO3\\CMS\\Frontend\\Tests\\Unit\\Configuration\\TypoScript\\ConditionMatching\\Fixtures\\TestCondition = 7, != 6]');
670 }
671 }