Skip to content

Commit

Permalink
Improve tests a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravan Scafi committed Dec 11, 2019
1 parent 2d46136 commit c41dfb3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/Mongolid/DataMapper/DataMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,13 @@ public function testDifferentialUpdateShouldWork()
$mapper = m::mock(DataMapper::class.'[parseToDocument,getCollection]', [$connPool]);

$collection = m::mock(Collection::class);
$parsedObject = ['_id' => 123, 'name' => 'Original Name', 'age' => 32, 'address' => null, 'other' => null];
$originalAttributes = ['_id' => 123, 'name' => 'Original Name', 'address' => '1 Blue street', 'gender' => 'm'];
$parsedObject = ['_id' => 123, 'name' => 'Original Name', 'age' => 32, 'hobbies' => ['bike', 'skate'], 'address' => null, 'other' => null];
$originalAttributes = ['_id' => 123, 'name' => 'Original Name', 'hobbies' => ['bike', 'motorcycle', 'gardening'], 'address' => '1 Blue street', 'gender' => 'm', 'nullField' => null];
$operationResult = m::mock();
$options = ['writeConcern' => new WriteConcern(1)];

$entity->_id = 123;
$updateData = ['$set' => ['age' => 32], '$unset' => ['address' => '', 'gender' => '']];
$updateData = ['$set' => ['age' => 32, 'hobbies.1' => 'skate'], '$unset' => ['hobbies.2' => '', 'address' => '', 'gender' => '', 'nullField' => '']];

// Act
$mapper->shouldAllowMockingProtectedMethods();
Expand Down

0 comments on commit c41dfb3

Please sign in to comment.