Doctrine\MongoDB\Tests\Query\BuilderTest::testDateRange PHP Method

testDateRange() public method

public testDateRange ( )
    public function testDateRange()
    {
        $start = new \MongoDate(strtotime('1985-09-01 01:00:00'));
        $end = new \MongoDate(strtotime('1985-09-04'));
        $qb = $this->getTestQueryBuilder();
        $qb->field('createdAt')->range($start, $end);
        $expected = ['createdAt' => ['$gte' => $start, '$lt' => $end]];
        $this->assertEquals($expected, $qb->getQueryArray());
    }
BuilderTest