I use prophecy to write unit tests
"require": {
...,
"phpspec/prophecy-phpunit": "~1.0"
},
and i have a call
$dbUser = $this
->em
->getRepository('MainBundle:User')
->findOneById($id);
when testing, I get an error because the findOneByProperty method is not defined. Except for changing the source code to:
$dbUser = $this
->em
->getRepository('MainBundle:User')
->findOneBy(array('id' => $id);
I did not find another solution. Is there a way to verify this using prophecy and keep the source code?
source
share