Skip to content

Commit 91fbc2d

Browse files
committed
minor #455 Minimizing test matrix + fixing tests (weaverryan)
This PR was squashed before being merged into the 1.0-dev branch (closes #455). Discussion ---------- Minimizing test matrix + fixing tests Trying to strike a balance between having a very robust test suite, and one that takes too long to execute & blocks jobs under the `symfony/` organization. Commits ------- 6d75f13 Adding support for new ErrorHandler DebugClassLoader cd4ec4e changing from RegistryInterface to ManagerRegistry - #454 e622635 adding mysql service 3ebce10 Slightly minimizing our test matrix to try to reduce burden on Travis
2 parents ade1f13 + 6d75f13 commit 91fbc2d

File tree

6 files changed

+20
-26
lines changed

6 files changed

+20
-26
lines changed

.travis.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ cache:
55
- $HOME/.composer/cache/files
66
- $HOME/symfony-bridge/.phpunit
77

8+
services:
9+
- mysql
10+
811
env:
912
global:
1013
- PHPUNIT_FLAGS="-v"
@@ -13,30 +16,14 @@ env:
1316
matrix:
1417
fast_finish: true
1518
include:
16-
- php: 7.1
17-
- php: 7.2
1819
- php: 7.3
1920
- php: 7.1
2021
env: MAKER_TEST_VERSION=stable-dev
2122
- php: 7.1
2223
env: MAKER_TEST_VERSION=dev
2324

24-
# the following need to be refactored properly into allow_failures
25-
# allow_failures:
26-
# # low deps is still a WIP
27-
# - php: 7.1
28-
# env: deps=low
29-
# # Dev-master is allowed to fail.
30-
# - env: STABILITY="dev"
31-
3225
before_install:
33-
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
34-
- |
35-
if [[ $deps = low ]]; then
36-
composer update --prefer-lowest
37-
else
38-
composer update
39-
fi
26+
- composer update
4027

4128
install:
4229
- ./vendor/bin/simple-phpunit install

src/Test/MakerTestEnvironment.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,16 @@ private function getTargetFlexVersion(): string
439439
$version = $data['latest'];
440440
$parts = explode('.', $version);
441441

442-
return sprintf('%s.%s.x-dev', $parts[0], $parts[1]);
442+
$this->targetFlexVersion = sprintf('%s.%s.x-dev', $parts[0], $parts[1]);
443+
444+
break;
443445
case 'dev':
444446
$version = $data['dev'];
445447
$parts = explode('.', $version);
446448

447-
return sprintf('%s.%s.x-dev', $parts[0], $parts[1]);
449+
$this->targetFlexVersion = sprintf('%s.%s.x-dev', $parts[0], $parts[1]);
450+
451+
break;
448452
default:
449453
throw new \Exception('Invalid target version');
450454
}

src/Util/ComposerAutoloaderFinder.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Composer\Autoload\ClassLoader;
1515
use Symfony\Component\Debug\DebugClassLoader;
16+
use Symfony\Component\ErrorHandler\DebugClassLoader as ErrorHandlerDebugClassLoader;
1617

1718
/**
1819
* @internal
@@ -82,7 +83,9 @@ private function extractComposerClassLoader(array $autoloader)
8283
if ($autoloader[0] instanceof ClassLoader) {
8384
return $autoloader[0];
8485
}
85-
if ($autoloader[0] instanceof DebugClassLoader
86+
if (
87+
($autoloader[0] instanceof DebugClassLoader
88+
|| $autoloader[0] instanceof ErrorHandlerDebugClassLoader)
8689
&& \is_array($autoloader[0]->getClassLoader())
8790
&& $autoloader[0]->getClassLoader()[0] instanceof ClassLoader) {
8891
return $autoloader[0]->getClassLoader()[0];

tests/Doctrine/fixtures/expected_xml/src/Repository/UserRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Symfony\Bundle\MakerBundle\Tests\tmp\current_project_xml\src\Entity\UserXml;
66
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
7-
use Symfony\Bridge\Doctrine\RegistryInterface;
7+
use Doctrine\Common\Persistence\ManagerRegistry;
88

99
/**
1010
* @method UserXml|null find($id, $lockMode = null, $lockVersion = null)
@@ -14,7 +14,7 @@
1414
*/
1515
class UserRepository extends ServiceEntityRepository
1616
{
17-
public function __construct(RegistryInterface $registry)
17+
public function __construct(ManagerRegistry $registry)
1818
{
1919
parent::__construct($registry, UserXml::class);
2020
}

tests/Doctrine/fixtures/expected_xml/src/Repository/XOtherRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Symfony\Bundle\MakerBundle\Tests\tmp\current_project_xml\src\Entity\XOther;
66
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
7-
use Symfony\Bridge\Doctrine\RegistryInterface;
7+
use Doctrine\Common\Persistence\ManagerRegistry;
88

99
/**
1010
* @method XOther|null find($id, $lockMode = null, $lockVersion = null)
@@ -14,7 +14,7 @@
1414
*/
1515
class XOtherRepository extends ServiceEntityRepository
1616
{
17-
public function __construct(RegistryInterface $registry)
17+
public function __construct(ManagerRegistry $registry)
1818
{
1919
parent::__construct($registry, XOther::class);
2020
}

tests/fixtures/MakeCrudRepository/src/Repository/SweetFoodRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use App\Entity\SweetFood;
66
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
7-
use Symfony\Bridge\Doctrine\RegistryInterface;
7+
use Doctrine\Common\Persistence\ManagerRegistry;
88

99
/**
1010
* @method SweetFood|null find($id, $lockMode = null, $lockVersion = null)
@@ -14,7 +14,7 @@
1414
*/
1515
class SweetFoodRepository extends ServiceEntityRepository
1616
{
17-
public function __construct(RegistryInterface $registry)
17+
public function __construct(ManagerRegistry $registry)
1818
{
1919
parent::__construct($registry, SweetFood::class);
2020
}

0 commit comments

Comments
 (0)