Thanks for your response,

But still a problem. Now I have this:

        $sm = ServiceManagerFactory::getServiceManager();
        $this->repository =
$sm->get('Doctrine\ORM\EntityManager')->getRepository('My\EntityRepository\Product');
        $this->assertInstanceOf('My\EntityRepository\Product',
$this->repository);

Generates the error:
1) MyTest\Controller\OverviewControllerTest::testEditActionAcceptsId
Doctrine\ORM\Mapping\MappingException: Class "My\EntityRepository\Product"
 sub class of "Doctrine\ORM\EntityRepository" is not a valid entity or
mapped su
per class.

Does this mean that I don't load the actual directory where my Entity
Repository Lives?
Or is there something else going wrong.


Thanks.









On Fri, Jun 28, 2013 at 7:25 PM, Marco Pivetta <[email protected]> wrote:

> 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
>>>>
>>>
>>>
>


-- 
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

Reply via email to