Skip to content
Permalink
Browse files

Using valid syntax for SQLServer in test case

Revert "More debugging to fix sql server"

This reverts commit 12f60b5.

Putting back the debugging code

More debugging code

More debugging

More debugging

REmoving debug code
  • Loading branch information...
lorenzo committed Dec 20, 2015
1 parent 15983de commit 8cae1585b75ae084e40cf8ae1b1c495beb73a81a
Showing with 9 additions and 4 deletions.
  1. +1 −1 appveyor.yml
  2. +0 −1 src/Database/Driver/Sqlserver.php
  3. +8 −2 tests/TestCase/ORM/QueryRegressionTest.php
@@ -80,4 +80,4 @@ before_test:
test_script:
- sqlcmd -S ".\SQL2012SP1" -U sa -P Password12! -Q "create database cakephp;"
- cd C:\projects\cakephp
- vendor\bin\phpunit.bat --filter testCountWithComplexOrderBy tests/TestCase/ORM/QueryRegressionTest.php
- vendor\bin\phpunit.bat --filter testPaginateQueryWithBindValue
@@ -109,7 +109,6 @@ public function prepare($query)
$options = [];
}
$statement = $this->_connection->prepare($isObject ? $query->sql() : $query, $options);
debug($statement->queryString);
return new SqlserverStatement($statement, $this);
}
@@ -1217,16 +1217,22 @@ public function testCountWithComplexOrderBy()
{
$table = TableRegistry::get('Articles');
$query = $table->find();
$query->orderDesc($query->newExpr()->add(['id' => 3]));
$query->orderDesc($query->newExpr()->addCase(
[$query->newExpr()->add(['id' => 3])],
[1, 0]
));
$query->order(['title' => 'desc']);
// Executing the normal query before getting the count
$query->all();
$this->assertEquals(3, $query->count());
$table = TableRegistry::get('Articles');
$query = $table->find();
$query->orderDesc($query->newExpr()->addCase(
[$query->newExpr()->add(['id' => 3])],
[1, 0]
));
$query->orderDesc($query->newExpr()->add(['id' => 3]));
$query->order(['title' => 'desc']);
// Not executing the query first, just getting the count
$this->assertEquals(3, $query->count());
}

0 comments on commit 8cae158

Please sign in to comment.
You can’t perform that action at this time.