-
Notifications
You must be signed in to change notification settings - Fork 51
add mongodb writer to writer plugin manager #38
Conversation
@@ -146,6 +147,53 @@ public function testRetrievesDatabaseServiceFromServiceManagerWhenEncounteringDb | |||
$this->assertAttributeSame($db, 'db', $writer); | |||
} | |||
|
|||
public function testRetrievesMongoDBServiceFromServiceManagerWhenEncounteringMongoDbWriter() | |||
{ | |||
$mongoClient = $this->getMockBuilder('MongoClient') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test should check for existence of the mongodb extension prior, and mark the test skipped if it is not. I can make that change on merge.
Ouch... there's another problem. Evidently, Travis is installing ext/mongodb, vs ext/mongo, with current builds. ext/mongodb does not ship the I'm not quite sure how to resolve this, but I'm a bit reluctant to expose the mongo writer unless we know it also works with ext/mongodb. Thoughts? |
I'd say let's make two separate writers: 1) mongo 2) mongodb for ext-mongo and ext-mongodb. |
About travis: I can install both extensions for travis, this is no big deal. |
run hhvm tests on travis
I guess we run into the same problems as mentioned in the zend-session component. We should use an extra repo (e.g. zend-log-mongodb) for specific writer, which relies on dependencies. |
@weierophinney If you want me to change this to separate repos, please create those repos for me so I can make the split. Otherwise it should be ready to merge. |
ping @weierophinney |
* @param string $database | ||
* @param string $collection | ||
* @param array $saveOptions | ||
* @throws Exception\InvalidArgumentException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add @throws Exception\ExtensionNotLoadedException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
|
||
$this->mongoCollection->expects($this->once()) | ||
->method('save') | ||
->with($this->contains(new MongoDate($date->getTimestamp()), false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MongoDB\BSON\UTCDateTime
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is MongoTest, not MongoDBTest
$saveOptions = isset($mongo['save_options']) ? $mongo['save_options'] : []; | ||
$collection = isset($mongo['collection']) ? $mongo['collection'] : null; | ||
$database = isset($mongo['database']) ? $mongo['database'] : null; | ||
$mongo = isset($mongo['mongo']) ? $mongo['mongo'] : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wish we were on PHP 7 as the minimum version, so we could use ??
here. 😦
add mongodb writer to writer plugin manager
Merged to develop for release with 2.9.0. |
resolves #37