Skip to content
Permalink
Browse files

tests: Lets use rear entity instead of mock.

  • Loading branch information...
tarlepp committed Sep 16, 2019
1 parent 3eb81f8 commit 13c618d438f2e2ab751b37caa1119eb1d9f062ba
Showing with 2 additions and 14 deletions.
  1. +2 −14 tests/Integration/Resource/GenericResourceTest.php
@@ -10,7 +10,7 @@
use App\DTO\RestDtoInterface;
use App\DTO\User\User as UserDto;
use App\Entity\EntityInterface;
use App\Entity\ApiKey as ApiKeyEntity;
use App\Entity\User as UserEntity;
use App\Repository\UserRepository;
use App\Resource\UserResource;
@@ -375,7 +375,7 @@ public function testThatCountCallsExpectedRepositoryMethodWithCorrectParameters(
*/
public function testThatSaveMethodCallsExpectedRepositoryMethod(): void
{
$entity = $this->getEntityInterfaceMock();
$entity = new ApiKeyEntity();
/** @var MockObject|UserRepository $repository */
$repository = $this->getRepositoryMockBuilder()->disableOriginalConstructor()->getMock();
@@ -728,18 +728,6 @@ private function getRepositoryMockBuilder(): MockBuilder
->setConstructorArgs([static::getEntityManager(), new ClassMetadata($this->entityClass)]);
}
/**
* @return MockObject|EntityInterface
*
* @throws Throwable
*/
private function getEntityInterfaceMock(): MockObject
{
return $this
->getMockBuilder(EntityInterface::class)
->getMock();
}
/**
* @return MockObject|UserEntity
*

0 comments on commit 13c618d

Please sign in to comment.
You can’t perform that action at this time.