Skip to content

Commit

Permalink
Change 3th argument of bulkwrite to array
Browse files Browse the repository at this point in the history
  • Loading branch information
gmsantos committed Mar 14, 2018
1 parent f5539e9 commit 58cdd06
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ php:
- 7.1

before_install:
- if [[ $TRAVIS_PHP_VERSION = 7.0 ]]; then pecl install mongodb; fi
- pecl install mongodb
- echo "extension = mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

before_script:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"require": {
"php": ">=7.0",
"mongodb/mongodb": "^1.1",
"mongodb/mongodb": "^1.3",
"illuminate/container": "^5.4"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion src/Mongolid/DataMapper/BulkWrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function execute($writeConcern = 1)
return $manager->executeBulkWrite(
$namespace,
$this->getBulkWrite(),
new WriteConcern($writeConcern)
['writeConcern' => new WriteConcern($writeConcern)]
);
}
}
2 changes: 1 addition & 1 deletion tests/Mongolid/DataMapper/BulkWriteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function testShouldExecuteBulkWrite()

$manager->shouldReceive('executeBulkWrite')
->once()
->with($namespace, $mongoBulkWrite, m::type(WriteConcern::class))
->with($namespace, $mongoBulkWrite, ['writeConcern' => new WriteConcern(1)])
->andReturn(true);

$bulkWrite = m::mock(BulkWrite::class.'[getBulkWrite]', [$entity]);
Expand Down

0 comments on commit 58cdd06

Please sign in to comment.