Sonata\Tests\ProductBundle\Entity\ProductManagerTest::getProductManager PHP Method

getProductManager() protected method

protected getProductManager ( $qbCallback )
    protected function getProductManager($qbCallback)
    {
        if (version_compare(\PHPUnit_Runner_Version::id(), '5.0.0', '>=')) {
            $this->markTestSkipped('Not compatible with PHPUnit 5.');
        }
        $em = EntityManagerMockFactory::create($this, $qbCallback, array('sku', 'slug', 'name'));
        $registry = $this->getMock('Doctrine\\Common\\Persistence\\ManagerRegistry');
        $registry->expects($this->any())->method('getManagerForClass')->will($this->returnValue($em));
        return new ProductManager('Sonata\\PageBundle\\Entity\\BaseProduct', $registry);
    }