[FEATURE] TypoScript: Allow easy comparison against multiple values
[Packages/TYPO3.CMS.git] / tests / Unit / t3lib / matchcondition / class.t3lib_matchcondition_backendTest.php
index 6736c81..e146857 100644 (file)
@@ -377,6 +377,22 @@ class t3lib_matchCondition_backendTest 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
@@ -386,6 +402,15 @@ class t3lib_matchCondition_backendTest 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