Sokil\Mongo\DocumentGeoTest::testExpressionWithinBox PHP Method

testExpressionWithinBox() public method

    public function testExpressionWithinBox()
    {
        $this->collection->ensure2dIndex('point');
        $point1Id = $this->collection->createDocument()->setLegacyPoint('point', 5, 4)->save()->getId();
        $point2Id = $this->collection->createDocument()->setLegacyPoint('point', 50, 40)->save()->getId();
        $point = $this->collection->find()->withinBox('point', array(0, 0), array(10, 10))->findOne();
        $this->assertNotEmpty($point);
        $this->assertEquals($point1Id, $point->getId());
    }