Browse Source

Added a test with multiple calls to modifier

Juan Basso 12 years ago
parent
commit
2b6044afa4
1 changed files with 8 additions and 0 deletions
  1. 8 0
      tests/TestCase/Database/QueryTest.php

+ 8 - 0
tests/TestCase/Database/QueryTest.php

@@ -1101,6 +1101,14 @@ class QueryTest extends TestCase {
 		$result = $query
 			->select(['city', 'state', 'country'])
 			->from(['addresses'])
+			->modifier('DISTINCTROW')
+			->modifier('SQL_NO_CACHE');
+		$this->assertSame('SELECT DISTINCTROW SQL_NO_CACHE city, state, country FROM addresses', $result->sql());
+
+		$query = new Query($this->connection);
+		$result = $query
+			->select(['city', 'state', 'country'])
+			->from(['addresses'])
 			->modifier(['TOP 10']);
 		$this->assertSame('SELECT TOP 10 city, state, country FROM addresses', $result->sql());
 	}