I have repositories defined as services in my code. You can fetch your
repository with something like:
ServiceManagerFactory::getServiceManager()->get('Doctrine\ORM\EntityManager')->getRepository('My\Entity\Name');
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
On 28 June 2013 19:23, Jigal sanders <[email protected]> wrote:
> Not sure how to check that.
> I'm trying to follow the example you sent me earlier this week.
>
> Thanks
>
> J
> Op 28 jun. 2013 19:20 schreef "Marco Pivetta" <[email protected]> het
> volgende:
>
> Is your repository actually defined as a service?
>>
>> Marco Pivetta
>>
>> http://twitter.com/Ocramius
>>
>> http://ocramius.github.com/
>>
>>
>> On 28 June 2013 18:47, Jigal sanders <[email protected]> wrote:
>>
>>> Hello,
>>>
>>> I am keeping to get the following error:
>>>
>>> 1) MyTest\Controller\OverviewControllerTest::testEditActionAcceptsId
>>> Zend\ServiceManager\Exception\ServiceNotFoundException:
>>> Zend\ServiceManager\Serv
>>> iceManager::get was unable to fetch or create an instance for
>>> myt\EntityRepository\Product
>>>
>>>
>>> this is how I Run the test:
>>>
>>>
>>>
>>> $sm = ServiceManagerFactory::getServiceManager();
>>> $this->repository = $sm->get(
>>> 'Kasjroet\EntityRepository\Product');
>>> $this->assertInstanceOf('Kasjroet\EntityRepository\Product',
>>> $this->repository);
>>>
>>> Any suggestions?
>>>
>>> Thanks,
>>>
>>> J. Sanders
>>>
>>
>>