Skip to content

Commit 2a310c4

Browse files
authored
Merge pull request #195 from symfony-cmf/fix-build
fix build matrix
2 parents 4f39a29 + da80f0e commit 2a310c4

File tree

16 files changed

+72
-145
lines changed

16 files changed

+72
-145
lines changed

.styleci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ enabled:
2626
- strict
2727
- php_unit_construct
2828

29-
disabled: [single_line_class_definition]
29+
disabled:
30+
- single_line_class_definition
31+
- single_line_throw

.travis.yml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
############################################################################
88
# This file is part of the Symfony CMF package. #
99
# #
10-
# (c) 2011-2017 Symfony CMF #
10+
# (c) Symfony CMF #
1111
# #
1212
# For the full copyright and license information, please view the LICENSE #
1313
# file that was distributed with this source code. #
@@ -16,52 +16,49 @@
1616
language: php
1717

1818
php:
19-
- 7.1
2019
- 7.2
2120
- 7.3
21+
- 7.4
2222
sudo: false
2323

2424
cache:
2525
directories:
2626
- .phpunit
27-
- $HOME/.composer/cache/files
27+
- $HOME/.composer/cache
2828

2929
env:
30-
matrix: SYMFONY_VERSION=4.2.*
3130
global:
32-
- SYMFONY_DEPRECATIONS_HELPER="/.*each.*/"
33-
- SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml"
34-
- SYMFONY_PHPUNIT_VERSION=7
35-
- PHPUNIT_VERSION=7
31+
- SYMFONY_PHPUNIT_VERSION=8
3632
- TARGET=test
33+
- COMPOSER_MEMORY_LIMIT=-1
3734

3835
matrix:
3936
include:
40-
- php: 7.3
41-
env: STABILITY="dev" SYMFONY_VERSION=4.3.*
42-
- php: 7.3
43-
env: SYMFONY_VERSION=4.2.*
4437
- php: 7.1
45-
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=3.4.* SYMFONY_DEPRECATIONS_HELPER="/.*each.*/"
46-
- php: 7.2
47-
env: SYMFONY_VERSION=4.1.*
38+
env: COMPOSER_FLAGS="--prefer-lowest --prefer-stable" SYMFONY_REQUIRE=3.4.* SYMFONY_PHPUNIT_VERSION=6 SYMFONY_DEPRECATIONS_HELPER=weak
39+
- php: 7.4
40+
env: SYMFONY_REQUIRE=4.3.*
41+
- php: 7.4
42+
env: SYMFONY_REQUIRE=4.4.*
43+
- php: 7.4
44+
env: SYMFONY_REQUIRE=4.4.* SYMFONY_PHPUNIT_VERSION=7
45+
- php: 7.4
46+
env: STABILITY="dev" SYMFONY_VERSION=4.4.*
4847
fast_finish: true
4948
allow_failures:
50-
- php: 7.3
51-
env: STABILITY="dev" SYMFONY_VERSION=4.3.*
49+
- php: 7.4
50+
env: STABILITY="dev" SYMFONY_REQUIRE=4.4.*
5251

5352
before_install:
5453
- phpenv config-rm xdebug.ini || true
55-
- composer self-update
56-
- composer validate --no-check-all --ansi
54+
- composer global require --no-progress --no-scripts --no-plugins symfony/flex
5755
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; composer config prefer-stable true; fi;
58-
- if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION} --no-update; fi
59-
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
6056

6157
install: travis_wait composer update --prefer-dist $COMPOSER_FLAGS
6258

6359
script:
64-
- if [ "${TEST_INSTALLATION}" == true ]; then make test_installation; else make test; fi
60+
- composer validate --no-check-all --ansi
61+
- make test
6562

6663
notifications:
6764
irc: "irc.freenode.org#symfony-cmf"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44
3.0.0 (unreleased)
55
------------------
66

7+
* **2019-12-05**: [BC-BREAK] Support PHPUnit 6, 7 and 8, drop support for PHPUnit 5.7
78
* **2019-07-26**: [BC-BREAK] Remove deprecated `BaseTestCase::getClient`, use `BaseTestCase::getFrameworkBundleClient` instead.
89
* **2019-02-28**: [BC-BREAK] Remove `DatabaseTestListener`, use scripts in `bin/make/` to ramp up your testing environment for several test suites
910
* **2019-02-28**: [BC-BREAK] Introduce PHPUnit 6 Support, Remove PHPUnit 5.7.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ list:
3030
include ${TESTING_SCRIPTS_DIR}/make/unit_tests.mk
3131

3232
.PHONY: test
33-
test: build/xdebug-filter.php unit_tests
33+
test: unit_tests
3434
lint-php:
3535
php-cs-fixer fix --ansi --verbose --diff --dry-run
3636
.PHONY: lint-php

README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ under the [MIT License](LICENSE).
2020
**NOTE**: This is an internal tool and is not intended to be used outside of
2121
the context of the CMF.
2222

23-
24-
## Requirements
25-
26-
* PHP 7.1 / 7.2 / 7.3
27-
* Symfony 3.4 / 4.0 / 4.1 / 4.2
28-
* See also the `require` section of [composer.json](composer.json)
29-
3023
## Documentation
3124

3225
For the install guide and reference, see:

bin/make/functional_tests_orm.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ functional_tests_orm:
88
@${CONSOLE} doctrine:schema:create --env=orm
99
@echo '+++ run ORM functional tests +++'
1010
ifeq ($(HAS_XDEBUG), 0)
11-
@vendor/bin/simple-phpunit --prepend build/xdebug-filter.php -c phpunit.xml.dist --coverage-clover build/logs/clover.xml --testsuite "functional tests with orm"
11+
@vendor/bin/simple-phpunit --coverage-clover build/logs/clover.xml --testsuite "functional tests with orm"
1212
else
13-
@vendor/bin/simple-phpunit -c phpunit.xml.dist --testsuite "functional tests with orm"
13+
@vendor/bin/simple-phpunit --testsuite "functional tests with orm"
1414
endif
1515
@${CONSOLE} doctrine:database:drop --force

bin/make/functional_tests_phpcr.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ functional_tests_phpcr:
77
@${CONSOLE} doctrine:phpcr:repository:init
88
@echo '+++ run PHPCR functional tests +++'
99
ifeq ($(HAS_XDEBUG), 0)
10-
@vendor/bin/simple-phpunit --prepend build/xdebug-filter.php -c phpunit.xml.dist --coverage-clover build/logs/clover.xml --testsuite "functional tests with phpcr"
10+
@vendor/bin/simple-phpunit --coverage-clover build/logs/clover.xml --testsuite "functional tests with phpcr"
1111
else
12-
@vendor/bin/simple-phpunit -c phpunit.xml.dist --testsuite "functional tests with phpcr"
12+
@vendor/bin/simple-phpunit --testsuite "functional tests with phpcr"
1313
endif
1414
@${CONSOLE} doctrine:database:drop --force

bin/make/unit_tests.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ unit_tests:
33
@echo
44
@echo '+++ run unit tests +++'
55
ifeq ($(HAS_XDEBUG), 0)
6-
@vendor/bin/simple-phpunit --prepend build/xdebug-filter.php -c phpunit.xml.dist --coverage-clover build/logs/clover.xml --testsuite "unit tests"
6+
@vendor/bin/simple-phpunit --coverage-clover build/logs/clover.xml --testsuite "unit tests"
77
else
8-
@vendor/bin/simple-phpunit -c phpunit.xml.dist --testsuite "unit tests"
8+
@vendor/bin/simple-phpunit --testsuite "unit tests"
99
endif

src/Functional/BaseTestCase.php

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,44 +46,31 @@ abstract class BaseTestCase extends WebTestCase
4646
*
4747
* * environment - The environment to use (defaults to 'phpcr')
4848
* * debug - If debug should be enabled/disabled (defaults to true)
49-
*
50-
* @return array
5149
*/
52-
protected function getKernelConfiguration()
50+
protected function getKernelConfiguration(): array
5351
{
5452
return [];
5553
}
5654

57-
/**
58-
* Gets the Client.
59-
*
60-
* @return Client
61-
*/
62-
public function getFrameworkBundleClient()
55+
public function getFrameworkBundleClient(): Client
6356
{
6457
if (null === $this->client) {
58+
// property does not exist in all symfony versions
59+
if (\property_exists(self::class, 'booted') && self::$booted) {
60+
self::ensureKernelShutdown();
61+
}
6562
$this->client = self::createClient($this->getKernelConfiguration());
6663
}
6764

6865
return $this->client;
6966
}
7067

71-
/**
72-
* Gets the container.
73-
*
74-
* @return ContainerInterface
75-
*/
76-
public function getContainer()
68+
public function getContainer(): ContainerInterface
7769
{
7870
return $this->getKernel()->getContainer();
7971
}
8072

81-
/**
82-
* Ensures the kernel is available.
83-
*
84-
* @return KernelInterface
85-
*/
86-
public function getKernel()
73+
public function getKernel(): KernelInterface
8774
{
8875
if (null === static::$kernel) {
8976
parent::bootKernel(static::getKernelConfiguration());
@@ -152,7 +139,7 @@ public function getDbManager($type)
152139
return $dbManager;
153140
}
154141

155-
public static function getKernelClass()
142+
public static function getKernelClass(): string
156143
{
157144
if (isset($_SERVER['KERNEL_CLASS']) || isset($_ENV['KERNEL_CLASS'])) {
158145
$class = isset($_SERVER['KERNEL_CLASS']) ? $_SERVER['KERNEL_CLASS'] : $_ENV['KERNEL_CLASS'];
@@ -171,7 +158,7 @@ public static function getKernelClass()
171158
*
172159
* This is overriden to set the default environment to 'phpcr'
173160
*/
174-
protected static function createKernel(array $options = [])
161+
protected static function createKernel(array $options = []): KernelInterface
175162
{
176163
// default environment is 'phpcr'
177164
if (!isset($options['environment'])) {

src/Functional/DbManager/ORM.php

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,12 @@ public function __construct(ContainerInterface $container)
5555
$this->container = $container;
5656
}
5757

58-
/**
59-
* Gets the Doctrine ManagerRegistry.
60-
*
61-
* @return ManagerRegistry
62-
*/
63-
public function getRegistry()
58+
public function getRegistry(): ManagerRegistry
6459
{
6560
return $this->container->get('doctrine');
6661
}
6762

68-
/**
69-
* Gets the Doctrine ObjectManager.
70-
*
71-
* @param null $managerName
72-
*
73-
* @return ObjectManager
74-
*/
75-
public function getOm($managerName = null)
63+
public function getOm($managerName = null): ObjectManager
7664
{
7765
if (!$this->om) {
7866
$this->om = $this->getRegistry()->getManager($managerName);
@@ -84,19 +72,17 @@ public function getOm($managerName = null)
8472
/**
8573
* Purge the database.
8674
*/
87-
public function purgeDatabase()
75+
public function purgeDatabase(): void
8876
{
8977
$referenceRepository = new ProxyReferenceRepository($this->getOm());
9078
$this->getExecutor()->setReferenceRepository($referenceRepository);
9179
$this->getExecutor()->purge();
9280
}
9381

9482
/**
95-
* Loads fixture classes.
96-
*
9783
* @param string[] $classNames
9884
*/
99-
public function loadFixtures(array $classNames)
85+
public function loadFixtures(array $classNames): void
10086
{
10187
$this->purgeDatabase();
10288
$loader = new ContainerAwareLoader($this->container);
@@ -108,13 +94,7 @@ public function loadFixtures(array $classNames)
10894
$this->getExecutor()->execute($loader->getFixtures(), true);
10995
}
11096

111-
/**
112-
* Loads a single fixture.
113-
*
114-
* @param Loader $loader
115-
* @param string $className
116-
*/
117-
protected function loadFixtureClass(Loader $loader, $className)
97+
protected function loadFixtureClass(Loader $loader, string $className): void
11898
{
11999
if (!class_exists($className)) {
120100
throw new \InvalidArgumentException(sprintf(
@@ -140,12 +120,7 @@ protected function loadFixtureClass(Loader $loader, $className)
140120
}
141121
}
142122

143-
/**
144-
* Return the ORM Executor class.
145-
*
146-
* @return ORMExecutor
147-
*/
148-
private function getExecutor()
123+
private function getExecutor(): ORMExecutor
149124
{
150125
if ($this->executor) {
151126
return $this->executor;

0 commit comments

Comments
 (0)