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 @@ -1541,7 +1541,7 @@ public static function count(/* ... */)
15411541 $ table = static ::table ();
15421542 $ sql = $ table ->options_to_sql ($ options );
15431543 $ values = $ sql ->get_where_values ();
1544- return static ::connection ()->query_and_fetch_one ($ sql ->to_s (),$ values );
1544+ return ( int ) static ::connection ()->query_and_fetch_one ($ sql ->to_s (),$ values );
15451545 }
15461546
15471547 /**
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