Skip to content

Commit d2dc95a

Browse files
authored
Merge pull request #3025 from phansys/doctrine_persistence
Replace usages of old namespace `Doctrine\Common\Persistence\` with `Doctrine\Persistence\` ("doctrine/persistence" >= 1.3)
2 parents 813161b + 446c394 commit d2dc95a

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Resources/config/doctrine.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</service>
1414

1515
<!-- The factory is configured in the DI extension class to support more Symfony versions -->
16-
<service id="fos_user.object_manager" class="Doctrine\Common\Persistence\ObjectManager" public="false">
16+
<service id="fos_user.object_manager" class="Doctrine\Persistence\ObjectManager" public="false">
1717
<argument>%fos_user.model_manager_name%</argument>
1818
</service>
1919

Tests/Doctrine/UserManagerTest.php

+8-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
namespace FOS\UserBundle\Tests\Doctrine;
1313

14+
use Doctrine\Persistence\Mapping\ClassMetadata;
15+
use Doctrine\Persistence\ObjectManager;
16+
use Doctrine\Persistence\ObjectRepository;
1417
use FOS\UserBundle\Doctrine\UserManager;
1518
use FOS\UserBundle\Model\User;
1619
use PHPUnit\Framework\TestCase;
@@ -28,17 +31,17 @@ class UserManagerTest extends TestCase
2831

2932
public function setUp()
3033
{
31-
if (!interface_exists('Doctrine\Common\Persistence\ObjectManager')) {
32-
$this->markTestSkipped('Doctrine Common has to be installed for this test to run.');
34+
if (!interface_exists(ObjectManager::class)) {
35+
$this->markTestSkipped('"doctrine/persistence" ^1.3 has to be installed for this test to run.');
3336
}
3437

3538
$passwordUpdater = $this->getMockBuilder('FOS\UserBundle\Util\PasswordUpdaterInterface')->getMock();
3639
$fieldsUpdater = $this->getMockBuilder('FOS\UserBundle\Util\CanonicalFieldsUpdater')
3740
->disableOriginalConstructor()
3841
->getMock();
39-
$class = $this->getMockBuilder('Doctrine\Common\Persistence\Mapping\ClassMetadata')->getMock();
40-
$this->om = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager')->getMock();
41-
$this->repository = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectRepository')->getMock();
42+
$class = $this->getMockBuilder(ClassMetadata::class)->getMock();
43+
$this->om = $this->getMockBuilder(ObjectManager::class)->getMock();
44+
$this->repository = $this->getMockBuilder(ObjectRepository::class)->getMock();
4245

4346
$this->om->expects($this->any())
4447
->method('getRepository')

0 commit comments

Comments
 (0)