Skip to content

Compatibility with ext-mongodb 0.6 #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
{ "name": "Derick Rethans", "email": "[email protected]" }
],
"require": {
"ext-mongodb": ">=0.5.1"
},
"require-dev": {
"fzaninotto/faker": "~1.0"
"ext-mongodb": ">=0.6.0"
},
"autoload": {
"psr-4": { "MongoDB\\": "src/" }
Expand Down
32 changes: 0 additions & 32 deletions tests/Collection/CollectionFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace MongoDB\Tests\Collection;

use MongoDB\Tests\FixtureGenerator;

/**
* Functional tests for the Collection class.
*/
Expand All @@ -18,34 +16,4 @@ public function testDrop()
$this->assertCommandSucceeded($commandResult);
$this->assertCollectionCount($this->getNamespace(), 0);
}

function testInsertAndRetrieve()
{
$generator = new FixtureGenerator();

for ($i = 0; $i < 10; $i++) {
$user = $generator->createUser();
$result = $this->collection->insertOne($user);
$this->assertInstanceOf('MongoDB\InsertOneResult', $result);
$this->assertInstanceOf('BSON\ObjectId', $result->getInsertedId());
$this->assertEquals(24, strlen($result->getInsertedId()));

$user["_id"] = $result->getInsertedId();
$document = $this->collection->findOne(array("_id" => $result->getInsertedId()));
$this->assertEquals($document, $user, "The inserted and returned objects are the same");
}

$this->assertEquals(10, $i);

$query = array("firstName" => "Ransom");
$count = $this->collection->count($query);
$this->assertEquals(1, $count);
$cursor = $this->collection->find($query);
$this->assertInstanceOf('MongoDB\Driver\Cursor', $cursor);

foreach($cursor as $n => $person) {
$this->assertInternalType("array", $person);
}
$this->assertEquals(0, $n);
}
}
1 change: 0 additions & 1 deletion tests/Database/CollectionManagementFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public function testListCollectionsWithFilter()

$collections = $this->database->listCollections($options);
$this->assertInstanceOf('MongoDB\Model\CollectionInfoIterator', $collections);
$this->assertCount(1, $collections);

foreach ($collections as $collection) {
$this->assertInstanceOf('MongoDB\Model\CollectionInfo', $collection);
Expand Down
59 changes: 0 additions & 59 deletions tests/FixtureGenerator.php

This file was deleted.