Skip to content

Commit

Permalink
Simplify mock building calls
Browse files Browse the repository at this point in the history
Co-authored-by: Grégoire Paris <[email protected]>
  • Loading branch information
acoulton and greg0ire authored Apr 7, 2021
1 parent 1f4e6eb commit 67dfe8e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function testResolveDiscriminatorsForClass(): void
$classMetadata->name = 'Some\Class\Name';
$classMetadata->discriminatorValue = 'discriminator';

$em = $this->getMockBuilder(EntityManagerInterface::class)->getMock();
$em = $this->createMock(EntityManagerInterface::class);
$em->expects($this->exactly(2))
->method('getClassMetadata')
->willReturnMap(
Expand All @@ -46,7 +46,7 @@ public function testResolveDiscriminatorsForClassWithNoSubclasses(): void
$classMetadata->name = 'Some\Class\Name';
$classMetadata->discriminatorValue = 'discriminator';

$em = $this->getMockBuilder(EntityManagerInterface::class)->getMock();
$em = $this->createMock(EntityManagerInterface::class);
$em->expects($this->exactly(1))
->method('getClassMetadata')
->with($classMetadata->name)
Expand Down

0 comments on commit 67dfe8e

Please sign in to comment.