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
264
264
265
265
$ commandResult = $ this ->collection ->drop ();
266
266
$ this ->assertCommandSucceeded ($ commandResult );
267
- $ this ->assertCollectionCount ($ this ->getNamespace (), 0 );
267
+ $ this ->assertCollectionDoesNotExist ($ this ->getCollectionName () );
268
268
}
269
269
270
270
/**
Original file line number Diff line number Diff line change @@ -159,6 +159,19 @@ public function testDrop(): void
159
159
$ this ->assertCollectionCount ($ this ->getNamespace (), 0 );
160
160
}
161
161
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
+
162
175
public function testGetSelectsCollectionAndInheritsOptions (): void
163
176
{
164
177
$ databaseOptions = ['writeConcern ' => new WriteConcern (WriteConcern::MAJORITY )];
You can’t perform that action at this time.
0 commit comments