From 76cabea9c251dfbfd5da1a58c2ba6450fbd33244 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Thu, 1 Feb 2018 13:15:00 -0500 Subject: [PATCH] Fix namespaces in test classes The Operation classes were previously relying on MongoDB\Tests\Collection\FunctionalTestCase, so they required additional changes to initialize a Collection instance for asserting outcome of write operations. --- tests/Model/BSONArrayTest.php | 3 ++- tests/Model/BSONDocumentTest.php | 3 ++- tests/Model/CollectionInfoTest.php | 2 +- tests/Model/DatabaseInfoTest.php | 2 +- tests/Model/IndexInfoTest.php | 2 +- tests/Model/IndexInputTest.php | 2 +- tests/Model/TypeMapArrayIteratorTest.php | 3 ++- tests/Operation/BulkWriteFunctionalTest.php | 5 ++++- tests/Operation/DeleteFunctionalTest.php | 12 +++++++++++- tests/Operation/InsertManyFunctionalTest.php | 12 +++++++++++- tests/Operation/InsertOneFunctionalTest.php | 12 +++++++++++- tests/Operation/UpdateFunctionalTest.php | 5 ++++- 12 files changed, 51 insertions(+), 12 deletions(-) diff --git a/tests/Model/BSONArrayTest.php b/tests/Model/BSONArrayTest.php index 9f4191e79..c01bd0ced 100644 --- a/tests/Model/BSONArrayTest.php +++ b/tests/Model/BSONArrayTest.php @@ -1,9 +1,10 @@ collection = new Collection($this->manager, $this->getDatabaseName(), $this->getCollectionName()); $this->omitModifiedCount = version_compare($this->getServerVersion(), '2.6.0', '<'); } diff --git a/tests/Operation/DeleteFunctionalTest.php b/tests/Operation/DeleteFunctionalTest.php index 588083f1d..b76a4b819 100644 --- a/tests/Operation/DeleteFunctionalTest.php +++ b/tests/Operation/DeleteFunctionalTest.php @@ -1,14 +1,24 @@ collection = new Collection($this->manager, $this->getDatabaseName(), $this->getCollectionName()); + } + public function testDeleteOne() { $this->createFixtures(3); diff --git a/tests/Operation/InsertManyFunctionalTest.php b/tests/Operation/InsertManyFunctionalTest.php index fb7a535ef..902338cfd 100644 --- a/tests/Operation/InsertManyFunctionalTest.php +++ b/tests/Operation/InsertManyFunctionalTest.php @@ -1,7 +1,8 @@ collection = new Collection($this->manager, $this->getDatabaseName(), $this->getCollectionName()); + } + public function testInsertMany() { $documents = [ diff --git a/tests/Operation/InsertOneFunctionalTest.php b/tests/Operation/InsertOneFunctionalTest.php index f7f362cd9..7accb7f6b 100644 --- a/tests/Operation/InsertOneFunctionalTest.php +++ b/tests/Operation/InsertOneFunctionalTest.php @@ -1,7 +1,8 @@ collection = new Collection($this->manager, $this->getDatabaseName(), $this->getCollectionName()); + } + /** * @dataProvider provideDocumentWithExistingId */ diff --git a/tests/Operation/UpdateFunctionalTest.php b/tests/Operation/UpdateFunctionalTest.php index 1a5013a39..20f300fb4 100644 --- a/tests/Operation/UpdateFunctionalTest.php +++ b/tests/Operation/UpdateFunctionalTest.php @@ -1,7 +1,8 @@ collection = new Collection($this->manager, $this->getDatabaseName(), $this->getCollectionName()); $this->omitModifiedCount = version_compare($this->getServerVersion(), '2.6.0', '<'); }