Commit 1ec1e2a0 authored by Jens Segers's avatar Jens Segers

Adding subkey test

parent 86f22ab3
...@@ -42,4 +42,28 @@ class QueryTest extends PHPUnit_Framework_TestCase { ...@@ -42,4 +42,28 @@ class QueryTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('John Doe', $user['name']); $this->assertEquals('John Doe', $user['name']);
} }
public function testSubKey()
{
$user1 = array(
'name' => 'John Doe',
'address' => array(
'country' => 'Belgium',
'city' => 'Ghent'
)
);
$user2 = array(
'name' => 'Jane Doe',
'address' => array(
'country' => 'France',
'city' => 'Paris'
)
);
DB::collection('users')->insert(array($user1, $user2));
$users = DB::collection('users')->where('address.country', 'Belgium')->get();
$this->assertEquals(1, count($users));
}
} }
\ No newline at end of file
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