From 3ebce10da56a84f3212b2e431fb4d669dc50ba9c Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Mon, 12 Aug 2019 17:27:41 -0400 Subject: [PATCH 1/4] Slightly minimizing our test matrix to try to reduce burden on Travis --- .travis.yml | 18 +----------------- src/Test/MakerTestEnvironment.php | 8 ++++++-- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index e157db863..e3c10a302 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,30 +13,14 @@ env: matrix: fast_finish: true include: - - php: 7.1 - - php: 7.2 - php: 7.3 - php: 7.1 env: MAKER_TEST_VERSION=stable-dev - php: 7.1 env: MAKER_TEST_VERSION=dev -# the following need to be refactored properly into allow_failures -# allow_failures: -# # low deps is still a WIP -# - php: 7.1 -# env: deps=low -# # Dev-master is allowed to fail. -# - env: STABILITY="dev" - before_install: - - if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi; - - | - if [[ $deps = low ]]; then - composer update --prefer-lowest - else - composer update - fi + - composer update install: - ./vendor/bin/simple-phpunit install diff --git a/src/Test/MakerTestEnvironment.php b/src/Test/MakerTestEnvironment.php index 55b2cff06..aa25b7796 100644 --- a/src/Test/MakerTestEnvironment.php +++ b/src/Test/MakerTestEnvironment.php @@ -439,12 +439,16 @@ private function getTargetFlexVersion(): string $version = $data['latest']; $parts = explode('.', $version); - return sprintf('%s.%s.x-dev', $parts[0], $parts[1]); + $this->targetFlexVersion = sprintf('%s.%s.x-dev', $parts[0], $parts[1]); + + break; case 'dev': $version = $data['dev']; $parts = explode('.', $version); - return sprintf('%s.%s.x-dev', $parts[0], $parts[1]); + $this->targetFlexVersion = sprintf('%s.%s.x-dev', $parts[0], $parts[1]); + + break; default: throw new \Exception('Invalid target version'); } From e622635fb324bc178c820924ab1e23a9651688ef Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Mon, 12 Aug 2019 17:36:49 -0400 Subject: [PATCH 2/4] adding mysql service --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index e3c10a302..9c6efc4b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,9 @@ cache: - $HOME/.composer/cache/files - $HOME/symfony-bridge/.phpunit +services: + - mysql + env: global: - PHPUNIT_FLAGS="-v" From cd4ec4ed5281e229d3b0b0fcdb92116e54188c41 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Mon, 12 Aug 2019 21:44:44 -0400 Subject: [PATCH 3/4] changing from RegistryInterface to ManagerRegistry - #454 --- .../fixtures/expected_xml/src/Repository/UserRepository.php | 4 ++-- .../fixtures/expected_xml/src/Repository/XOtherRepository.php | 4 ++-- .../MakeCrudRepository/src/Repository/SweetFoodRepository.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Doctrine/fixtures/expected_xml/src/Repository/UserRepository.php b/tests/Doctrine/fixtures/expected_xml/src/Repository/UserRepository.php index 1e7ea450c..2fc694c08 100644 --- a/tests/Doctrine/fixtures/expected_xml/src/Repository/UserRepository.php +++ b/tests/Doctrine/fixtures/expected_xml/src/Repository/UserRepository.php @@ -4,7 +4,7 @@ use Symfony\Bundle\MakerBundle\Tests\tmp\current_project_xml\src\Entity\UserXml; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Symfony\Bridge\Doctrine\RegistryInterface; +use Doctrine\Common\Persistence\ManagerRegistry; /** * @method UserXml|null find($id, $lockMode = null, $lockVersion = null) @@ -14,7 +14,7 @@ */ class UserRepository extends ServiceEntityRepository { - public function __construct(RegistryInterface $registry) + public function __construct(ManagerRegistry $registry) { parent::__construct($registry, UserXml::class); } diff --git a/tests/Doctrine/fixtures/expected_xml/src/Repository/XOtherRepository.php b/tests/Doctrine/fixtures/expected_xml/src/Repository/XOtherRepository.php index 0db82d653..5893db7df 100644 --- a/tests/Doctrine/fixtures/expected_xml/src/Repository/XOtherRepository.php +++ b/tests/Doctrine/fixtures/expected_xml/src/Repository/XOtherRepository.php @@ -4,7 +4,7 @@ use Symfony\Bundle\MakerBundle\Tests\tmp\current_project_xml\src\Entity\XOther; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Symfony\Bridge\Doctrine\RegistryInterface; +use Doctrine\Common\Persistence\ManagerRegistry; /** * @method XOther|null find($id, $lockMode = null, $lockVersion = null) @@ -14,7 +14,7 @@ */ class XOtherRepository extends ServiceEntityRepository { - public function __construct(RegistryInterface $registry) + public function __construct(ManagerRegistry $registry) { parent::__construct($registry, XOther::class); } diff --git a/tests/fixtures/MakeCrudRepository/src/Repository/SweetFoodRepository.php b/tests/fixtures/MakeCrudRepository/src/Repository/SweetFoodRepository.php index 305ba0722..a103546d7 100644 --- a/tests/fixtures/MakeCrudRepository/src/Repository/SweetFoodRepository.php +++ b/tests/fixtures/MakeCrudRepository/src/Repository/SweetFoodRepository.php @@ -4,7 +4,7 @@ use App\Entity\SweetFood; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Symfony\Bridge\Doctrine\RegistryInterface; +use Doctrine\Common\Persistence\ManagerRegistry; /** * @method SweetFood|null find($id, $lockMode = null, $lockVersion = null) @@ -14,7 +14,7 @@ */ class SweetFoodRepository extends ServiceEntityRepository { - public function __construct(RegistryInterface $registry) + public function __construct(ManagerRegistry $registry) { parent::__construct($registry, SweetFood::class); } From 6d75f131d081754e093fd786dc585cb58e1cb54b Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Mon, 12 Aug 2019 22:26:01 -0400 Subject: [PATCH 4/4] Adding support for new ErrorHandler DebugClassLoader --- src/Util/ComposerAutoloaderFinder.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Util/ComposerAutoloaderFinder.php b/src/Util/ComposerAutoloaderFinder.php index 0618fa752..7cc9c04ba 100644 --- a/src/Util/ComposerAutoloaderFinder.php +++ b/src/Util/ComposerAutoloaderFinder.php @@ -13,6 +13,7 @@ use Composer\Autoload\ClassLoader; use Symfony\Component\Debug\DebugClassLoader; +use Symfony\Component\ErrorHandler\DebugClassLoader as ErrorHandlerDebugClassLoader; /** * @internal @@ -78,7 +79,9 @@ private function extractComposerClassLoader(array $autoloader) if ($autoloader[0] instanceof ClassLoader) { return $autoloader[0]; } - if ($autoloader[0] instanceof DebugClassLoader + if ( + ($autoloader[0] instanceof DebugClassLoader + || $autoloader[0] instanceof ErrorHandlerDebugClassLoader) && \is_array($autoloader[0]->getClassLoader()) && $autoloader[0]->getClassLoader()[0] instanceof ClassLoader) { return $autoloader[0]->getClassLoader()[0];