File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed
tests/integration/Collection Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -869,7 +869,7 @@ public static function findFirst(array $parameters = []): ?CollectionInterface
869869 public static function findById ($ id ): ?CollectionInterface
870870 {
871871 if (!is_object ($ id )) {
872- if (!preg_match ("/^[a-f\d]{24}$/i " , $ id )) {
872+ if (!preg_match ("/^[a-f\d]{24}$/i " , ( string ) $ id )) {
873873 return null ;
874874 }
875875
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ public function mvcCollectionFindById(IntegrationTester $I)
7171 {
7272 $ I ->wantToTest ('Mvc\Collection - findById() ' );
7373
74+ $ I ->assertNull (Robots::findById (null ));
7475 $ I ->assertNull (Robots::findById (new ObjectId ()));
7576 $ I ->assertInstanceOf (Robots::class, Robots::findById ($ this ->tmpId ));
7677 $ I ->assertInstanceOf (Robots::class, Robots::findById ((string )$ this ->tmpId ));
You can’t perform that action at this time.
0 commit comments