Browse Source

Fixing problem in test

Jose Lorenzo Rodriguez 10 years ago
parent
commit
629dd25244
1 changed files with 7 additions and 8 deletions
  1. 7 8
      tests/TestCase/Database/QueryTest.php

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

@@ -2795,25 +2795,24 @@ class QueryTest extends TestCase
         $query = new Query($this->connection);
         $result = $query->select(
             function ($q) {
-                    return ['total' => $q->func()->count('*')];
+                return ['total' => $q->func()->count('*')];
             }
         )
-            ->from('articles')
+            ->from('comments')
             ->execute();
-        $expected = [['total' => 3]];
+        $expected = [['total' => 6]];
         $this->assertEquals($expected, $result->fetchAll('assoc'));
 
         $query = new Query($this->connection);
         $result = $query->select([
-                'c' => $query->func()->concat(['title' => 'literal', ' is appended'])
+                'c' => $query->func()->concat(['comment' => 'literal', ' is appended'])
             ])
-            ->from('articles')
+            ->from('comments')
             ->order(['c' => 'ASC'])
+            ->limit(1)
             ->execute();
         $expected = [
-            ['c' => 'First Article is appended'],
-            ['c' => 'Second Article is appended'],
-            ['c' => 'Third Article is appended']
+            ['c' => 'First Comment for First Article is appended'],
         ];
         $this->assertEquals($expected, $result->fetchAll('assoc'));