Commit 802e6c32 authored by Jens Segers's avatar Jens Segers

Adding test for subdocument updates

parent 7d2468b6
......@@ -413,4 +413,18 @@ class QueryBuilderTest extends PHPUnit_Framework_TestCase {
$this->assertFalse(isset($user2['note2']));
}
public function testUpdateSubdocument()
{
DB::collection('users')->insertGetId(array(
'name' => 'John Doe',
'address' => array('country' => 'Belgium')
));
DB::collection('users')->where('name', 'John Doe')->update(array('address.country' => 'England'));
$check = DB::collection('users')->where('name', 'John Doe')->first();
$this->assertEquals('England', $check['address']['country']);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment