@@ -374,6 +374,9 @@ public function testRenameColumn(): void
374374
375375 public function testHasColumn (): void
376376 {
377+ $ this ->assertTrue (Schema::hasColumn ('newcollection ' , '_id ' ));
378+ $ this ->assertTrue (Schema::hasColumn ('newcollection ' , 'id ' ));
379+
377380 DB ::connection ()->table ('newcollection ' )->insert (['column1 ' => 'value ' ]);
378381
379382 $ this ->assertTrue (Schema::hasColumn ('newcollection ' , 'column1 ' ));
@@ -382,6 +385,9 @@ public function testHasColumn(): void
382385
383386 public function testHasColumns (): void
384387 {
388+ $ this ->assertTrue (Schema::hasColumns ('newcollection ' , ['_id ' ]));
389+ $ this ->assertTrue (Schema::hasColumns ('newcollection ' , ['id ' ]));
390+
385391 // Insert documents with both column1 and column2
386392 DB ::connection ()->table ('newcollection ' )->insert ([
387393 ['column1 ' => 'value1 ' , 'column2 ' => 'value2 ' ],
@@ -451,8 +457,9 @@ public function testGetColumns()
451457 $ this ->assertIsString ($ column ['comment ' ]);
452458 });
453459
454- $ this ->assertEquals ('objectId ' , $ columns ->get ('_id ' )['type ' ]);
455- $ this ->assertEquals ('objectId ' , $ columns ->get ('_id ' )['generation ' ]['type ' ]);
460+ $ this ->assertNull ($ columns ->get ('_id ' ), '_id is renamed to id ' );
461+ $ this ->assertEquals ('objectId ' , $ columns ->get ('id ' )['type ' ]);
462+ $ this ->assertEquals ('objectId ' , $ columns ->get ('id ' )['generation ' ]['type ' ]);
456463 $ this ->assertNull ($ columns ->get ('text ' )['generation ' ]);
457464 $ this ->assertEquals ('string ' , $ columns ->get ('text ' )['type ' ]);
458465 $ this ->assertEquals ('date ' , $ columns ->get ('date ' )['type ' ]);
0 commit comments