File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ public function testDrop(): void
264264
265265 $ commandResult = $ this ->collection ->drop ();
266266 $ this ->assertCommandSucceeded ($ commandResult );
267- $ this ->assertCollectionCount ($ this ->getNamespace (), 0 );
267+ $ this ->assertCollectionDoesNotExist ($ this ->getCollectionName () );
268268 }
269269
270270 /**
Original file line number Diff line number Diff line change @@ -159,6 +159,19 @@ public function testDrop(): void
159159 $ this ->assertCollectionCount ($ this ->getNamespace (), 0 );
160160 }
161161
162+ public function testDropCollection (): void
163+ {
164+ $ bulkWrite = new BulkWrite ();
165+ $ bulkWrite ->insert (['x ' => 1 ]);
166+
167+ $ writeResult = $ this ->manager ->executeBulkWrite ($ this ->getNamespace (), $ bulkWrite );
168+ $ this ->assertEquals (1 , $ writeResult ->getInsertedCount ());
169+
170+ $ commandResult = $ this ->database ->dropCollection ($ this ->getCollectionName ());
171+ $ this ->assertCommandSucceeded ($ commandResult );
172+ $ this ->assertCollectionDoesNotExist ($ this ->getCollectionName ());
173+ }
174+
162175 public function testGetSelectsCollectionAndInheritsOptions (): void
163176 {
164177 $ databaseOptions = ['writeConcern ' => new WriteConcern (WriteConcern::MAJORITY )];
You can’t perform that action at this time.
0 commit comments