Alcaeus\MongoDbAdapter\Tests\Mongo\MongoDBRefTest::testGet PHP Method

testGet() public method

public testGet ( )
    public function testGet()
    {
        $id = new \MongoId();
        $db = $this->getDatabase();
        $document = ['_id' => $id, 'foo' => 'bar'];
        $db->selectCollection('test')->insert($document);
        $fetchedRef = \MongoDBRef::get($db, ['$ref' => 'test', '$id' => $id]);
        $this->assertInternalType('array', $fetchedRef);
        $this->assertEquals($document, $fetchedRef);
    }