Browse Source

Fix PHPCS error and adding missing cast.

Mark Story 10 years ago
parent
commit
247c4a04f6

+ 1 - 1
src/Database/Dialect/SqlserverDialectTrait.php

@@ -113,7 +113,7 @@ trait SqlserverDialectTrait
             ->from(['_cake_paging_' => $query]);
 
         if ($offset) {
-            $outer->where(["$field > $offset"]);
+            $outer->where(["$field > " . (int)$offset]);
         }
         if ($limit) {
             $value = (int)$offset + (int)$limit;

+ 1 - 1
tests/TestCase/Controller/Component/PaginatorComponentTest.php

@@ -826,7 +826,7 @@ class PaginatorComponentTest extends TestCase
 
         $result = $this->Paginator->paginate($table);
         $this->assertCount(4, $result, '4 rows should come back');
-        $this->assertEquals(['First Post', 'Second Post', 'Third Post', 'Fourth Post'] , $titleExtractor($result));
+        $this->assertEquals(['First Post', 'Second Post', 'Third Post', 'Fourth Post'], $titleExtractor($result));
 
         $result = $this->request->params['paging']['PaginatorPosts'];
         $this->assertEquals(4, $result['current']);