File tree 2 files changed +6
-6
lines changed
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(/* ... */)
1541
1541
$ table = static ::table ();
1542
1542
$ sql = $ table ->options_to_sql ($ options );
1543
1543
$ 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 );
1545
1545
}
1546
1546
1547
1547
/**
Original file line number Diff line number Diff line change @@ -226,12 +226,12 @@ public function test_fetch_all()
226
226
227
227
public function test_count ()
228
228
{
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 )));
231
231
$ 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 )));
235
235
}
236
236
237
237
public function test_gh149_empty_count ()
You can’t perform that action at this time.
0 commit comments