fix: doctrine native lazy objects
This commit is contained in:
@@ -14,7 +14,7 @@ use App\Entity\Embeddable\Communication;
|
||||
use App\Entity\Teamer;
|
||||
use App\Entity\User;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\Persistence\ObjectRepository;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Log\LoggerInterface;
|
||||
@@ -511,7 +511,7 @@ class UserDataHandlerTest extends TestCase
|
||||
|
||||
$profileResponse = $this->createProfileResponse();
|
||||
|
||||
$repository = $this->createMock(ObjectRepository::class);
|
||||
$repository = $this->createMock(EntityRepository::class);
|
||||
$repository
|
||||
->expects($this->once())
|
||||
->method('findOneBy')
|
||||
@@ -562,7 +562,7 @@ class UserDataHandlerTest extends TestCase
|
||||
|
||||
$profileResponse = $this->createProfileResponse();
|
||||
|
||||
$repository = $this->createMock(ObjectRepository::class);
|
||||
$repository = $this->createMock(EntityRepository::class);
|
||||
$repository
|
||||
->expects($this->once())
|
||||
->method('findOneBy')
|
||||
@@ -607,7 +607,7 @@ class UserDataHandlerTest extends TestCase
|
||||
|
||||
$profileResponse = $this->createProfileResponse(null, null);
|
||||
|
||||
$repository = $this->createMock(ObjectRepository::class);
|
||||
$repository = $this->createMock(EntityRepository::class);
|
||||
$repository
|
||||
->expects($this->once())
|
||||
->method('findOneBy')
|
||||
@@ -669,7 +669,7 @@ class UserDataHandlerTest extends TestCase
|
||||
|
||||
$profileResponse = $this->createProfileResponse();
|
||||
|
||||
$repository = $this->createMock(ObjectRepository::class);
|
||||
$repository = $this->createMock(EntityRepository::class);
|
||||
$repository
|
||||
->expects($this->once())
|
||||
->method('findOneBy')
|
||||
|
||||
@@ -10,7 +10,7 @@ use App\RequiredTeamerCheck\RequiredTeamerCheckRegistry;
|
||||
use App\Security\MyEpAuthenticator;
|
||||
use App\Security\OAuth2\MyEpClient;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\Persistence\ObjectRepository;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Flagception\Manager\FeatureManagerInterface;
|
||||
use GuzzleHttp\Psr7\Request as Psr7Request;
|
||||
use GuzzleHttp\Psr7\Response as Psr7Response;
|
||||
@@ -30,7 +30,7 @@ use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
|
||||
class MyEpAuthenticatorTest extends TestCase
|
||||
{
|
||||
private EntityManagerInterface&MockObject $entityManager;
|
||||
private ObjectRepository&MockObject $repository;
|
||||
private EntityRepository&MockObject $repository;
|
||||
|
||||
/** @var User[] */
|
||||
private array $persisted = [];
|
||||
@@ -38,7 +38,7 @@ class MyEpAuthenticatorTest extends TestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->persisted = [];
|
||||
$this->repository = $this->createMock(ObjectRepository::class);
|
||||
$this->repository = $this->createMock(EntityRepository::class);
|
||||
$this->entityManager = $this->createMock(EntityManagerInterface::class);
|
||||
$this->entityManager->method('getRepository')->willReturn($this->repository);
|
||||
$this->entityManager
|
||||
|
||||
Reference in New Issue
Block a user