File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1464,7 +1464,7 @@ public static function count(/* ... */)
14641464 $ table = static ::table ();
14651465 $ sql = $ table ->options_to_sql ($ options );
14661466 $ values = $ sql ->get_where_values ();
1467- return static ::connection ()->query_and_fetch_one ($ sql ->to_s (),$ values );
1467+ return ( int ) static ::connection ()->query_and_fetch_one ($ sql ->to_s (),$ values );
14681468 }
14691469
14701470 /**
Original file line number Diff line number Diff line change @@ -226,12 +226,12 @@ public function test_fetch_all()
226226
227227 public function test_count ()
228228 {
229- $ this ->assert_equals (1 ,Author::count (1 ));
230- $ this ->assert_equals (2 ,Author::count (array (1 ,2 )));
229+ $ this ->assert_same (1 ,Author::count (1 ));
230+ $ this ->assert_same (2 ,Author::count (array (1 ,2 )));
231231 $ this ->assert_true (Author::count () > 1 );
232- $ this ->assert_equals (0 ,Author::count (array ('conditions ' => 'author_id=99999999999999 ' )));
233- $ this ->assert_equals (2 ,Author::count (array ('conditions ' => 'author_id=1 or author_id=2 ' )));
234- $ this ->assert_equals (1 ,Author::count (array ('name ' => 'Tito ' , 'author_id ' => 1 )));
232+ $ this ->assert_same (0 ,Author::count (array ('conditions ' => 'author_id=99999999999999 ' )));
233+ $ this ->assert_same (2 ,Author::count (array ('conditions ' => 'author_id=1 or author_id=2 ' )));
234+ $ this ->assert_same (1 ,Author::count (array ('name ' => 'Tito ' , 'author_id ' => 1 )));
235235 }
236236
237237 public function test_gh149_empty_count ()
You can’t perform that action at this time.
0 commit comments