我在ZF2 + Doctrine2项目中遇到PHPUnit测试失败:
$array1 = PopulateArray1();
$array2 = PopulateArray2();
$matchedRows = array();
foreach ($array1 as $item)
{
if(in_array($item, $array2))
{
$matchedRows[] = $item;
}
}
return $matchedRows;
我正在使用:
创建模拟存储库RuntimeException: Method "findAllByState" could not be found in repository "Mock_EntityRepository_4af853d8"
但这显然是不正确的。那么,如何跟踪PHPUnit模拟对象的创建以找出创建$repository = $this
->getMockBuilder('Doctrine\ORM\EntityRepository')
->disableOriginalConstructor()
->getMock();
$repository
->method('findAllByState')
->willReturn([]);
的位置,以便我可以告诉它Mock_EntityRepository_blah
?