8000 Merge branch '4.3' into 4.4 · symfony/symfony@4c69a26 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4c69a26

Browse files
Merge branch '4.3' into 4.4
* 4.3: Re-enable previously failing PHP 7.4 test cases [PhpUnitBridge] fix uninitialized variable Revert "bug #33618 fix tests depending on other components' tests (xabbuh)" install from source to include components tests
2 parents b5ff996 + 627833b commit 4c69a26

File tree

27 files changed

+616
-680
lines changed

27 files changed

+616
-680
lines changed

.travis.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ before_install:
7979
export COMPONENTS=$(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
8080
find ~/.phpenv -name xdebug.ini -delete
8181
82-
if [[ $TRAVIS_PHP_VERSION = 7.4* ]]; then
83-
export PHPUNIT_X="$PHPUNIT_X,issue-32995"
84-
fi
85-
8682
nanoseconds () {
8783
local cmd="date"
8884
local format="+%s%N"
@@ -269,12 +265,12 @@ install:
269265
tfold 'composer update' $COMPOSER_UP
270266
tfold 'phpunit install' ./phpunit install
271267
if [[ $deps = high ]]; then
272-
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && $COMPOSER_UP && $PHPUNIT_X$LEGACY'"
268+
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && $COMPOSER_UP --prefer-source && $PHPUNIT_X$LEGACY'"
273269
elif [[ $deps = low ]]; then
274270
[[ -e ~/php-ext/composer-lowest.lock.tar ]] && tar -xf ~/php-ext/composer-lowest.lock.tar
275271
tar -cf ~/php-ext/composer-lowest.lock.tar --files-from /dev/null
276272
php .github/rm-invalid-lowest-lock-files.php $COMPONENTS
277-
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && ([ -e composer.lock ] && ${COMPOSER_UP/update/install} || $COMPOSER_UP --prefer-lowest --prefer-stable) && $PHPUNIT_X'"
273+
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && ([ -e composer.lock ] && ${COMPOSER_UP/update/install} || $COMPOSER_UP --prefer-lowest --prefer-stable --prefer-source) && $PHPUNIT_X'"
278274
echo "$COMPONENTS" | xargs -n1 -I{} tar --append -f ~/php-ext/composer-lowest.lock.tar {}/composer.lock
279275
else
280276
if [[ $PHP = 7.4* ]]; then

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public static function collectDeprecations($outputFile)
9696
{
9797
$deprecations = [];
9898
$previousErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$deprecations, &$previousErrorHandler) {
99-
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) {
99+
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type && (E_WARNING !== $type || false === strpos($msg, '" targeting switch is equivalent to "break')) {
100100
if ($previousErrorHandler) {
101101
return $previousErrorHandler($type, $msg, $file, $line, $context);
102102
}
@@ -119,7 +119,7 @@ public static function collectDeprecations($outputFile)
119119
*/
120120
public function handleError($type, $msg, $file, $line, $context = [])
121121
{
122-
if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) || !$this->getConfiguration()->isEnabled()) {
122+
if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type && (E_WARNING !== $type || false === strpos($msg, '" targeting switch is equivalent to "break')) || !$this->getConfiguration()->isEnabled()) {
123123
return \call_user_func(self::getPhpUnitErrorHandler(), $type, $msg, $file, $line, $context);
124124
}
125125

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,15 @@ class Deprecation
5353
*/
5454
private $triggeringFile;
5555

56-
/** @var string[] absolute paths to vendor directories */
56+
/** @var string[] Absolute paths to vendor directories */
5757
private static $vendors;
5858

5959
/**
60-
* @var string[] absolute paths to source or tests of the project. This
61-
* excludes cache directories, because it is based on
62-
* autoloading rules and cache systems typically do not use
63-
* those.
60+
* @var string[] Absolute paths to source or tests of the project, cache
61+
* directories exlcuded because it is based on autoloading
62+
* rules and cache systems typically do not use those
6463
*/
65-
private static $internalPaths;
64+
private static $internalPaths = [];
6665

6766
/**
6867
* @param string $message

src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ValidatorCacheWarmerTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020

2121
class ValidatorCacheWarmerTest extends TestCase
2222
{
23-
/**
24-
* @group issue-32995
25-
*
26-
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
27-
*/
2823
public function testWarmUp()
2924
{
3025
$validatorBuilder = new ValidatorBuilder();

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
2121
use Symfony\Component\DependencyInjection\ContainerInterface;
2222
use Symfony\Component\HttpFoundation\Request;
23-
use Symfony\Component\HttpKernel\Test\Controller\ContainerControllerResolverTestCase;
23+
use Symfony\Component\HttpKernel\Tests\Controller\ContainerControllerResolverTest;
2424

25-
class ControllerResolverTest extends ContainerControllerResolverTestCase
25+
class ControllerResolverTest extends ContainerControllerResolverTest
2626
{
2727
public function testGetControllerOnContainerAware()
2828
{

src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,6 @@ public function testPrune()
253253
$this->assertTrue($this->isPruned($cache, 'qux'));
254254
}
255255

256-
/**
257-
* @group issue-32995
258-
*
259-
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
260-
*/
261-
public function testSavingObject()
262-
{
263-
parent::testSavingObject();
264-
}
265-
266256
public function testClearPrefix()
267257
{
268258
if (isset($this->skippedTests[__FUNCTION__])) {

src/Symfony/Component/Config/Tests/Resource/ClassExistenceResourceTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,12 @@ public function testExistsKo()
7575
}
7676
}
7777

78-
/**
79-
* @group issue-32995
80-
*
81-
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
82-
*/
8378
public function testBadParentWithTimestamp()
8479
{
8580
$res = new ClassExistenceResource(BadParent::class, false);
8681
$this->assertTrue($res->isFresh(time()));
8782
}
8883

89-
/**
90-
* @group issue-32995
91-
*
92-
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
93-
*/
9484
public function testBadParentWithNoTimestamp()
9585
{
9686
$this->expectException('ReflectionException');

src/Symfony/Component/Debug/ErrorHandler.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,7 @@ private function reRegister(int $prev)
385385
*/
386386
public function handleError($type, $message, $file, $line)
387387
{
388-
// @deprecated to be removed in Symfony 5.0
389-
if (\PHP_VERSION_ID >= 70300 && $message && '"' === $message[0] && 0 === strpos($message, '"continue') && preg_match('/^"continue(?: \d++)?" targeting switch is equivalent to "break(?: \d++)?"\. Did you mean to use "continue(?: \d++)?"\?$/', $message)) {
388+
if (\PHP_VERSION_ID >= 70300 && E_WARNING === $type && '"' === $message[0] && false !== strpos($message, '" targeting switch is equivalent to "break')) {
390389
$type = E_DEPRECATED;
391390
}
392391

src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,6 @@ public function testClassNotFoundThrowsException()
349349
}
350350
}
351351

352-
/**
353-
* @group issue-32995
354-
*
355-
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
356-
*/
357352
public function testParentClassNotFoundThrowsException()
358353
{
359354
$container = new ContainerBuilder();
@@ -627,11 +622,6 @@ public function getCreateResourceTests()
627622
];
628623
}
629624

630-
/**
631-
* @group issue-32995
632-
*
633-
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
634-
*/
635625
public function testIgnoreServiceWithClassNotExisting()
636626
{
637627
$container = new ContainerBuilder();
@@ -834,11 +824,6 @@ public function testExceptionWhenAliasExists()
834824
}
835825
}
836826

837-
/**
838-
* @group issue-32995
839-
*
840-
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
841-
*/
842827
public function testExceptionWhenAliasDoesNotExist()
843828
{
844829
$container = new ContainerBuilder();

src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveBindingsPassTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ public function testUnusedBinding()
6565
$pass->process($container);
6666
}
6767

68-
/**
69-
* @group issue-32995
70-
*
71-
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
72-
*/
7368
public function testMissingParent()
7469
{
7570
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');

src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,11 +1098,6 @@ public function testInlineSelfRef()
10981098
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services_inline_self_ref.php', $dumper->dump(['class' => 'Symfony_DI_PhpDumper_Test_Inline_Self_Ref']));
10991099
}
11001100

1101-
/**
1102-
* @group issue-32995
1103-
*
1104-
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
1105-
*/
11061101
public function testHotPathOptimizations()
11071102
{
11081103
$container = include self::$fixturesPath.'/containers/container_inline_requires.php';

src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,6 @@ public function testRegisterClasses()
106106
);
107107
}
108108

109-
/**
110-
* @group issue-32995
111-
*
112-
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
113-
*/
114109
public function testRegisterClassesWithExclude()
115110
{
116111
$container = new ContainerBuilder();
@@ -140,11 +135,6 @@ public function testRegisterClassesWithExclude()
140135
);
141136
}
142137

143-
/**
144-
* @group issue-32995
145-
*
146-
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
147-
*/
148138
public function testRegisterClassesWithExcludeAsArray()
149139
{
150140
$container = new ContainerBuilder();
@@ -164,11 +154,6 @@ public function testRegisterClassesWithExcludeAsArray()
164154
$this->assertFalse($container->has(DeeperBaz::class));
165155
}
166156

167-
/**
168-
* @group issue-32995
169-
*
170-
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
171-
*/
172157
public function testNestedRegisterClasses()
173158
{
174159
$container = new ContainerBuilder();
@@ -197,11 +182,6 @@ public function testNestedRegisterClasses()
197182
10000 $this->assertFalse($alias->isPrivate());
198183
}
199184

200-
/**
201-
* @group issue-32995
202-
*
203-
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
204-
*/
205185
public function testMissingParentClass()
206186
{
207187
$container = new ContainerBuilder();

src/Symfony/Component/ErrorHandler/ErrorHandler.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,7 @@ private function reRegister(int $prev): void
401401
*/
402402
public function handleError(int $type, string $message, string $file, int $line): bool
403403
{
404-
// @deprecated to be removed in Symfony 5.0
405-
if (\PHP_VERSION_ID >= 70300 && $message && '"' === $message[0] && 0 === strpos($message, '"continue') && preg_match('/^"continue(?: \d++)?" targeting switch is equivalent to "break(?: \d++)?"\. Did you mean to use "continue(?: \d++)?"\?$/', $message)) {
404+
if (\PHP_VERSION_ID >= 70300 && E_WARNING === $type && '"' === $message[0] && false !== strpos($message, '" targeting switch is equivalent to "break')) {
406405
$type = E_DEPRECATED;
407406
}
408407

src/Symfony/Component/Form/Test/FormPerformanceTestCase.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Form\Test;
1313

14+
use Symfony\Component\Form\Tests\VersionAwareTest;
15+
1416
/**
1517
* Base class for performance tests.
1618
*

src/Symfony/Component/Form/Tests/AbstractLayoutTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 + C2EE 17,6 @@
1717
use Symfony\Component\Form\FormError;
1818
use Symfony\Component\Form\FormView;
1919
use Symfony\Component\Form\Test\FormIntegrationTestCase;
20-
use Symfony\Component\Form\Test\VersionAwareTest;
2120

2221
abstract class AbstractLayoutTest extends FormIntegrationTestCase
2322
{

src/Symfony/Component/Form/Tests/Extension/Core/Type/BaseTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
1313

1414
use Symfony\Component\Form\Test\TypeTestCase;
15-
use Symfony\Component\Form\Test\VersionAwareTest;
15+
use Symfony\Component\Form\Tests\VersionAwareTest;
1616

1717
/**
1818
* @author Bernhard Schussek <bschussek@gmail.com>

src/Symfony/Component/Form/Test/VersionAwareTest.php renamed to src/Symfony/Component/Form/Tests/VersionAwareTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\Form\Test;
12+
namespace Symfony\Component\Form\Tests;
1313

14-
/**
15-
* @internal
16-
*/
1714
trait VersionAwareTest
1815
{
1916
protected static $supportedFeatureSetVersion = 304;

0 commit comments

Comments
 (0)
0