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

getMockCollection() private method

private getMockCollection ( Doctrine\Common\EventManager $eventManager, array $methods )
$eventManager Doctrine\Common\EventManager
$methods array
    private function getMockCollection(EventManager $eventManager, array $methods)
    {
        $collection = $this->getMockBuilder('Doctrine\\MongoDB\\Collection')->setConstructorArgs([$this->database, $this->mongoCollection, $eventManager])->setMethods(array_keys($methods))->getMock();
        foreach ($methods as $method => $withValues) {
            $collection->expects($this->once())->method($method)->with(...$withValues);
        }
        return $collection;
    }