Skip to content

Commit 4aa9f95

Browse files
committed
Add integration tests for entity manager merge return
1 parent 2e944bd commit 4aa9f95

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

tests/DoctrineIntegration/ORM/EntityManagerIntegrationTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public function dataTopics(): array
1515
return [
1616
['entityManagerDynamicReturn'],
1717
['entityRepositoryDynamicReturn'],
18+
['entityManagerMergeReturn'],
1819
];
1920
}
2021

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace PHPStan\DoctrineIntegration\ORM\EntityManagerMergeReturn;
4+
5+
use Doctrine\ORM\EntityManagerInterface;
6+
7+
class Example
8+
{
9+
/**
10+
* @var EntityManagerInterface
11+
*/
12+
private $entityManager;
13+
14+
public function __construct(EntityManagerInterface $entityManager)
15+
{
16+
$this->entityManager = $entityManager;
17+
}
18+
19+
public function merge(): void
20+
{
21+
$test = $this->entityManager->merge(new MyEntity());
22+
$test->doSomething();
23+
}
24+
}
25+
26+
/**
27+
* @ORM\Entity()
28+
*/
29+
class MyEntity
30+
{
31+
public function doSomething(): void
32+
{
33+
}
34+
}

0 commit comments

Comments
 (0)