From ee386aecfebf0f1a805a09664f3935018178a4e8 Mon Sep 17 00:00:00 2001 From: Vincent Chalamon Date: Thu, 3 Sep 2020 13:52:41 +0200 Subject: [PATCH] Fix #60 --- .github/workflows/ci.yml | 5 +++- Manager/Bridge/DoctrineManager.php | 7 +++-- composer.json | 30 ++++++++++---------- tests/Manager/Bridge/DoctrineManagerTest.php | 12 ++++---- 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6afab5..5d8da69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,9 @@ on: schedule: - cron: 0 2 * * 1-5 pull_request: + push: + branches: + - master jobs: tests: @@ -21,7 +24,7 @@ jobs: symfony: - '3.4.*' - '4.4.*' - - '5.0.*' + - '5.1.*' dependency: - '--prefer-stable' - '--prefer-stable --prefer-lowest' diff --git a/Manager/Bridge/DoctrineManager.php b/Manager/Bridge/DoctrineManager.php index 55de17d..4268163 100644 --- a/Manager/Bridge/DoctrineManager.php +++ b/Manager/Bridge/DoctrineManager.php @@ -11,8 +11,6 @@ namespace CoopTilleuls\ForgotPasswordBundle\Manager\Bridge; -use Doctrine\Common\Persistence\ManagerRegistry; - /** * @author Vincent Chalamon */ @@ -20,7 +18,10 @@ final class DoctrineManager implements ManagerInterface { private $registry; - public function __construct(ManagerRegistry $registry) + /** + * @var \Doctrine\Common\Persistence\ManagerRegistry|\Doctrine\Persistence\ManagerRegistry + */ + public function __construct($registry) { $this->registry = $registry; } diff --git a/composer.json b/composer.json index 812c6e5..b8c08a7 100644 --- a/composer.json +++ b/composer.json @@ -18,12 +18,12 @@ "require": { "php": ">=7.2", "ircmaxell/random-lib": "^1.2", - "symfony/config": "^3.4 || ^4.4 || ^5.0", - "symfony/dependency-injection": "^3.4 || ^4.4 || ^5.0", - "symfony/event-dispatcher": "^3.4 || ^4.4 || ^5.0", - "symfony/http-foundation": "^3.4 || ^4.4 || ^5.0", - "symfony/http-kernel": "^3.4 || ^4.4 || ^5.0", - "symfony/serializer": "^3.4 || ^4.4 || ^5.0" + "symfony/config": "^3.4 || ^4.4 || ^5.1", + "symfony/dependency-injection": "^3.4 || ^4.4 || ^5.1", + "symfony/event-dispatcher": "^3.4 || ^4.4 || ^5.1", + "symfony/http-foundation": "^3.4 || ^4.4 || ^5.1", + "symfony/http-kernel": "^3.4 || ^4.4 || ^5.1", + "symfony/serializer": "^3.4 || ^4.4 || ^5.1" }, "require-dev": { "behat/behat": "^3.1", @@ -40,16 +40,16 @@ "phpunit/phpunit": "^8.0", "sebastian/comparator": "^3.0", "swiftmailer/swiftmailer": "^6.2", - "symfony/asset": "^3.4 || ^4.4 || ^5.0", - "symfony/browser-kit": "^3.4 || ^4.4 || ^5.0", - "symfony/framework-bundle": "^3.4 || ^4.4 || ^5.0", - "symfony/property-access": "^3.4 || ^4.4 || ^5.0", - "symfony/security-bundle": "^3.4 || ^4.4 || ^5.0", - "symfony/stopwatch": "^3.4 || ^4.4 || ^5.0", + "symfony/asset": "^3.4 || ^4.4 || ^5.1", + "symfony/browser-kit": "^3.4 || ^4.4 || ^5.1", + "symfony/framework-bundle": "^3.4 || ^4.4 || ^5.1", + "symfony/property-access": "^3.4 || ^4.4 || ^5.1", + "symfony/security-bundle": "^3.4 || ^4.4 || ^5.1", + "symfony/stopwatch": "^3.4 || ^4.4 || ^5.1", "symfony/swiftmailer-bundle": "^2.3.11 || ^3.4", - "symfony/templating": "^3.4 || ^4.4 || ^5.0", - "symfony/twig-bundle": "^3.4 || ^4.4 || ^5.0", - "symfony/var-dumper": "^3.4 || ^4.4 || ^5.0", + "symfony/templating": "^3.4 || ^4.4 || ^5.1", + "symfony/twig-bundle": "^3.4 || ^4.4 || ^5.1", + "symfony/var-dumper": "^3.4 || ^4.4 || ^5.1", "zendframework/zend-code": "^3.4" }, "suggest": { diff --git a/tests/Manager/Bridge/DoctrineManagerTest.php b/tests/Manager/Bridge/DoctrineManagerTest.php index dea467a..648218b 100644 --- a/tests/Manager/Bridge/DoctrineManagerTest.php +++ b/tests/Manager/Bridge/DoctrineManagerTest.php @@ -12,9 +12,9 @@ namespace Tests\ForgotPasswordBundle\Manager\Bridge; use CoopTilleuls\ForgotPasswordBundle\Manager\Bridge\DoctrineManager; -use Doctrine\Common\Persistence\ManagerRegistry; -use Doctrine\Common\Persistence\ObjectManager; -use Doctrine\Common\Persistence\ObjectRepository; +use Doctrine\Bundle\DoctrineBundle\Registry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; use PHPUnit\Framework\TestCase; /** @@ -33,9 +33,9 @@ final class DoctrineManagerTest extends TestCase protected function setUp(): void { - $this->registryMock = $this->prophesize(ManagerRegistry::class); - $this->managerMock = $this->prophesize(ObjectManager::class); - $this->repositoryMock = $this->prophesize(ObjectRepository::class); + $this->registryMock = $this->prophesize(Registry::class); + $this->managerMock = $this->prophesize(EntityManagerInterface::class); + $this->repositoryMock = $this->prophesize(EntityRepository::class); $this->objectMock = $this->prophesize(\stdClass::class); $this->doctrineManager = new DoctrineManager($this->registryMock->reveal());