Browse Source

Fix using of cast in existing test case cakephp#13694

mcsknp 6 years ago
parent
commit
579063c8ec
1 changed files with 2 additions and 6 deletions
  1. 2 6
      tests/TestCase/Database/QueryTest.php

+ 2 - 6
tests/TestCase/Database/QueryTest.php

@@ -4376,12 +4376,8 @@ class QueryTest extends TestCase
 
         //Postgres requires the case statement to be cast to a integer
         if ($this->connection->getDriver() instanceof \Cake\Database\Driver\Postgres) {
-            $publishedCase = $query->func()
-                ->cast([$publishedCase, 'integer' => 'literal'])
-                ->setConjunction(' AS ');
-            $notPublishedCase = $query->func()
-                ->cast([$notPublishedCase, 'integer' => 'literal'])
-                ->setConjunction(' AS ');
+            $publishedCase = $query->func()->cast($publishedCase, 'integer');
+            $notPublishedCase = $query->func()->cast($notPublishedCase, 'integer');
         }
 
         $results = $query