0011626.patch

Administrator Admin, 2009-08-02 16:09

Download (2.69 KB)

View differences:

tests/t3lib/t3lib_matchcondition_testcase.php (Arbeitskopie)
93 93

  
94 94
		$this->matchCondition->match('[browser = msie] && [version = 7] && [system = winNT]');
95 95
	}
96

  
97
	/**
98
	 * Tests whether numerical comparison matches.
99
	 * @test
100
	 */
101
	public function conditionMatchesOnEqualExpression() {
102
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 = 10]'));
103
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 = 10.1]'));
104

  
105
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 == 10]'));
106
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 == 10.1]'));
107
	}
108

  
109
	/**
110
	 * Tests whether numerical comparison matches.
111
	 * @test
112
	 */
113
	public function conditionMatchesOnNotEqualExpression() {
114
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 != 20]'));
115
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 != 10.2]'));
116
	}
117

  
118
	/**
119
	 * Tests whether numerical comparison matches.
120
	 * @test
121
	 */
122
	public function conditionMatchesOnLowerThanExpression() {
123
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 < 20]'));
124
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 < 10.2]'));
125
	}
126

  
127
	/**
128
	 * Tests whether numerical comparison matches.
129
	 * @test
130
	 */
131
	public function conditionMatchesOnLowerThanOrEqualExpression() {
132
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 <= 10]'));
133
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 <= 20]'));
134

  
135
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 <= 10.1]'));
136
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 <= 10.2]'));
137
	}
138

  
139
	/**
140
	 * Tests whether numerical comparison matches.
141
	 * @test
142
	 */
143
	public function conditionMatchesOnGreaterThanExpression() {
144
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:20 > 10]'));
145
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.2 > 10.1]'));
146
	}
147

  
148
	/**
149
	 * Tests whether numerical comparison matches.
150
	 * @test
151
	 */
152
	public function conditionMatchesOnGreaterThanOrEqualExpression() {
153
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 >= 10]'));
154
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:20 >= 10]'));
155

  
156
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 >= 10.1]'));
157
		$this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.2 >= 10.1]'));
158
	}
96 159
}
97 160
?>