Code Duplication    Length = 7-7 lines in 5 locations

tests/model/DataQueryTest.php 5 locations

@@ 228-234 (lines=7) @@
225
		$this->assertContains('SELECT DISTINCT', $query->sql($params), 'Query contains distinct');
226
 	}
227
228
	public function testComparisonClauseInt() {
229
		DB::query("INSERT INTO \"DataQueryTest_F\" (\"SortOrder\") VALUES (2)");
230
		$query = new DataQuery('DataQueryTest_F');
231
		$query->where(DB::get_conn()->comparisonClause('"SortOrder"', '2'));
232
		$this->assertGreaterThan(0, $query->count(), "Couldn't find SortOrder");
233
		$this->resetDBSchema(true);
234
	}
235
236
	public function testComparisonClauseDateFull() {
237
		DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')");
@@ 236-242 (lines=7) @@
233
		$this->resetDBSchema(true);
234
	}
235
236
	public function testComparisonClauseDateFull() {
237
		DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')");
238
		$query = new DataQuery('DataQueryTest_F');
239
		$query->where(DB::get_conn()->comparisonClause('"MyDate"', '1988-03-04%'));
240
		$this->assertGreaterThan(0, $query->count(), "Couldn't find MyDate");
241
		$this->resetDBSchema(true);
242
	}
243
244
	public function testComparisonClauseDateStartsWith() {
245
		DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')");
@@ 244-250 (lines=7) @@
241
		$this->resetDBSchema(true);
242
	}
243
244
	public function testComparisonClauseDateStartsWith() {
245
		DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')");
246
		$query = new DataQuery('DataQueryTest_F');
247
		$query->where(DB::get_conn()->comparisonClause('"MyDate"', '1988%'));
248
		$this->assertGreaterThan(0, $query->count(), "Couldn't find MyDate");
249
		$this->resetDBSchema(true);
250
	}
251
252
	public function testComparisonClauseDateStartsPartial() {
253
		DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')");
@@ 252-258 (lines=7) @@
249
		$this->resetDBSchema(true);
250
	}
251
252
	public function testComparisonClauseDateStartsPartial() {
253
		DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyDate\") VALUES ('1988-03-04 06:30')");
254
		$query = new DataQuery('DataQueryTest_F');
255
		$query->where(DB::get_conn()->comparisonClause('"MyDate"', '%03-04%'));
256
		$this->assertGreaterThan(0, $query->count(), "Couldn't find MyDate");
257
		$this->resetDBSchema(true);
258
	}
259
260
	public function testComparisonClauseTextCaseInsensitive() {
261
		DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyString\") VALUES ('HelloWorld')");
@@ 260-266 (lines=7) @@
257
		$this->resetDBSchema(true);
258
	}
259
260
	public function testComparisonClauseTextCaseInsensitive() {
261
		DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyString\") VALUES ('HelloWorld')");
262
		$query = new DataQuery('DataQueryTest_F');
263
		$query->where(DB::get_conn()->comparisonClause('"MyString"', 'helloworld'));
264
		$this->assertGreaterThan(0, $query->count(), "Couldn't find MyString");
265
		$this->resetDBSchema(true);
266
	}
267
268
	public function testComparisonClauseTextCaseSensitive() {
269
		DB::query("INSERT INTO \"DataQueryTest_F\" (\"MyString\") VALUES ('HelloWorld')");