return ($leftValue <= doubleval($rightValue));
break;
case '!=':
- return ($leftValue != doubleval($rightValue));
+ // multiple values may be split with '|'
+ // see if none matches ("not in list")
+ $found = FALSE;
+
+ $rightValueParts = t3lib_div::trimExplode('|', $rightValue);
+ foreach ($rightValueParts as $rightValueSingle) {
+ if ($leftValue === doubleval($rightValueSingle)) {
+ $found = TRUE;
+ break;
+ }
+ }
+
+ return ($found === FALSE);
break;
case '<':
return ($leftValue < doubleval($rightValue));
break;
default:
// nothing valid found except '=', use '='
- return ($leftValue == trim($rightValue));
+
+ // multiple values may be split with '|'
+ // see if one matches ("in list")
+ $found = FALSE;
+
+ $rightValueParts = t3lib_div::trimExplode('|', $rightValue);
+ foreach ($rightValueParts as $rightValueSingle) {
+ if ($leftValue == $rightValueSingle) {
+ $found = TRUE;
+ break;
+ }
+ }
+
+ return $found;
break;
}
}
$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
$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
$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
$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