diff --git a/.travis.yml b/.travis.yml index e157db863..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" @@ -13,30 +16,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'); } 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]; 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); }