Doctrine\MongoDB\Tests\CollectionEventsChangingContextTest::testFind PHP Method

testFind() public method

public testFind ( )
    public function testFind()
    {
        $query = ['a'];
        $fields = ['b'];
        $modifiedQuery = ['c'];
        $modifiedFields = ['d'];
        // This listener will modify the data and options.
        $preFindEventListener = new PreFindListener($modifiedQuery, $modifiedFields);
        $eventManager = new EventManager();
        $eventManager->addEventListener([Events::preFind], $preFindEventListener);
        // Ensure that the modified pipeline and options are sent to the doAggregate call.
        $collection = $this->getMockCollection($eventManager, ['doFind' => [$modifiedQuery, $modifiedFields]]);
        $collection->find($query, $fields);
    }