Code Duplication    Length = 6-9 lines in 2 locations

tests/model/SQLQueryTest.php 2 locations

@@ 92-97 (lines=6) @@
89
		);
90
	}
91
92
	public function testCanSortBy() {
93
		$query = new SQLQuery();
94
		$query->setSelect("Name","Meta")->setFrom("MyTable")->setWhere("Name = 'Name'")->addWhere("Meta = 'Test'");
95
		$this->assertTrue($query->canSortBy('Name ASC'));
96
		$this->assertTrue($query->canSortBy('Name'));
97
	}
98
99
	public function testSelectWithChainedFilterParameters() {
100
		$query = new SQLQuery();
@@ 99-107 (lines=9) @@
96
		$this->assertTrue($query->canSortBy('Name'));
97
	}
98
99
	public function testSelectWithChainedFilterParameters() {
100
		$query = new SQLQuery();
101
		$query->setSelect(array("Name","Meta"))->setFrom("MyTable");
102
		$query->setWhere("Name = 'Name'")->addWhere("Meta = 'Test'")->addWhere("Beta != 'Gamma'");
103
		$this->assertSQLEquals(
104
			"SELECT Name, Meta FROM MyTable WHERE (Name = 'Name') AND (Meta = 'Test') AND (Beta != 'Gamma')",
105
			$query->sql($parameters)
106
		);
107
	}
108
109
	public function testSelectWithLimitClause() {
110
		if(!(DB::get_conn() instanceof MySQLDatabase || DB::get_conn() instanceof SQLite3Database