use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
6
use Doctrine\ORM\EntityManagerInterface;
7
use Doctrine\Persistence\ManagerRegistry;
8
use PHPUnit\Framework\TestCase;
9
10
class ServiceEntityRepositoryTest extends TestCase
11
{
12
public static function setUpBeforeClass() : void
13
{
14
if (interface_exists(EntityManagerInterface::class)) {
15
return;
16
}
17
18
self::markTestSkipped('This test requires ORM');
19
}
20
21
/**
22
* @expectedException \LogicException
23
* @expectedExceptionMessage Could not find the entity manager for class "Doctrine\Bundle\DoctrineBundle\Tests\Repository\TestEntity". Check your Doctrine configuration to make sure it is configured to load this entity’s metadata.
24
*/
25
public function testConstructorThrowsExceptionWhenNoManagerFound() : void
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: