[FEATURE] TypoScript: Allow easy comparison against multiple values
[Packages/TYPO3.CMS.git] / tests / Unit / t3lib / matchcondition / class.t3lib_matchcondition_frontendTest.php
index 88827e9..ffc5eb4 100644 (file)
@@ -347,6 +347,22 @@ class t3lib_matchCondition_frontendTest extends tx_phpunit_testcase {
                $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 == 10.1]'));
        }
 
+       /**
+        * Tests whether numerical comparison matches.
+        * @test
+        */
+       public function globalVarConditionMatchesOnEqualExpressionWithMultipleValues() {
+               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 = 10|20|30]'));
+               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 = 10.1|20.2|30.3]'));
+               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:20 = 10|20|30]'));
+               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:20.2 = 10.1|20.2|30.3]'));
+
+               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 == 10|20|30]'));
+               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 == 10.1|20.2|30.3]'));
+               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:20 == 10|20|30]'));
+               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:20.2 == 10.1|20.2|30.3]'));
+       }
+
        /**
         * Tests whether numerical comparison matches.
         * @test
@@ -356,6 +372,15 @@ class t3lib_matchCondition_frontendTest extends tx_phpunit_testcase {
                $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 != 10.2]'));
        }
 
+       /**
+        * Tests whether numerical comparison matches.
+        * @test
+        */
+       public function globalVarConditionMatchesOnNotEqualExpressionWithMultipleValues() {
+               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 != 20|30]'));
+               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 != 10.2|20.3]'));
+       }
+
        /**
         * Tests whether numerical comparison matches.
         * @test