8000 Merge branch '4.4' into 5.0 · marcw/symfony@0b34b39 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b34b39

Browse files
Merge branch '4.4' into 5.0
* 4.4: [PhpUnitBridge] fix bad test [4.4] CS fixes [3.4] CS fixes Disable phpunit verbosity Queue name is a required parameter [FrameworkBundle] display actual target for error in AssetsInstallCommand Remove patches for Doctrine bugs and deprecations [Mime] fix bad method call on "EmailAddressContains" [DI][EventDispatcher] added contract for implementation
2 parents f825bf5 + 3783200 commit 0b34b39

File tree

17 files changed

+42
-43
lines changed

17 files changed

+42
-43
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ jobs:
8282
echo "::endgroup::"
8383
8484
- name: Run tests
85-
run: ./phpunit --verbose --group integration
85+
run: ./phpunit --group integration
8686
env:
87-
SYMFONY_DEPRECATIONS_HELPER: 'max[indirect]=7'
8887
REDIS_HOST: localhost
8988
REDIS_CLUSTER_HOSTS: 'localhost:7000 localhost:7001 localhost:7002 localhost:7003 localhost:7004 localhost:7005'
9089
MESSENGER_REDIS_DSN: redis://127.0.0.1:7006/messages
@@ -96,6 +95,6 @@ jobs:
9695
run: |
9796
[ -d .phpunit ] && mv .phpunit .phpunit.bak
9897
wget -q https://github.com/symfony/binary-utils/releases/download/v0.1/vulcain_0.1.3_Linux_x86_64.tar.gz -O - | tar xz && mv vulcain /usr/local/bin
99-
docker run --rm -e COMPOSER_ROOT_VERSION -e SYMFONY_VERSION -v $(pwd):/app -v $(which composer):/usr/local/bin/composer -v /usr/local/bin/vulcain:/usr/local/bin/vulcain -w /app php:7.4-alpine ./phpunit --verbose src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php --filter testHttp2Push
98+
docker run --rm -e COMPOSER_ROOT_VERSION -e SYMFONY_VERSION -v $(pwd):/app -v $(which composer):/usr/local/bin/composer -v /usr/local/bin/vulcain:/usr/local/bin/vulcain -w /app php:7.4-alpine ./phpunit src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php --filter testHttp2Push
10099
sudo rm -rf .phpunit
101100
[ -d .phpunit.bak ] && mv .phpunit.bak .phpunit

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"doctrine/cache": "~1.6",
105105
"doctrine/collections": "~1.0",
106106
"doctrine/data-fixtures": "1.0.*",
107-
"doctrine/dbal": "~2.4,<=2.10.2",
107+
"doctrine/dbal": "~2.4",
108108
"doctrine/orm": "~2.4,>=2.4.5",
109109
"doctrine/reflection": "~1.0",
110110
"doctrine/doctrine-bundle": "^2.0",

phpunit

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,4 @@ if (!getenv('SYMFONY_PATCH_TYPE_DECLARATIONS')) {
2121
putenv('SYMFONY_PATCH_TYPE_DECLARATIONS=deprecations=1');
2222
}
2323
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
24-
25-
if (!getenv('SYMFONY_DEPRECATIONS_HELPER')) {
26-
foreach ($_SERVER['argv'] as $v) {
27-
if (false !== strpos($v, 'Bridge/Doctrine')) {
28-
putenv('SYMFONY_DEPRECATIONS_HELPER=max[indirect]=7');
29-
break;
30-
}
31-
}
32-
}
33-
3424
require __DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';

src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrineTransactionMiddlewareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class DoctrineTransactionMiddlewareTest extends MiddlewareTestCase
2525
private $entityManager;
2626
private $middleware;
2727

28-
public function setUp(): void
28+
protected function setUp(): void
2929
{
3030
$this->connection = $this->createMock(Connection::class);
3131

src/Symfony/Bridge/Doctrine/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"doctrine/cache": "~1.6",
4343
"doctrine/collections": "~1.0",
4444
"doctrine/data-fixtures": "1.0.*",
45-
"doctrine/dbal": "~2.4,<=2.10.2",
45+
"doctrine/dbal": "~2.4",
4646
"doctrine/orm": "^2.6.3",
4747
"doctrine/reflection": "~1.0"
4848
},

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class DeprecationTest extends TestCase
2222
use SetUpTearDownTrait;
2323

2424
private static $vendorDir;
25+
private static $prefixDirsPsr4;
2526

2627
private static function getVendorDir()
2728
{
@@ -151,22 +152,6 @@ public function testItTakesMutesDeprecationFromPhpUnitFiles()
151152

152153
public function providerGetTypeDetectsSelf()
153154
{
154-
foreach (get_declared_classes() as $class) {
155-
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
156-
$r = new \ReflectionClass($class);
157-
$v = \dirname(\dirname($r->getFileName()));
158-
if (file_exists($v.'/composer/installed.json')) {
159-
$loader = require $v.'/autoload.php';
160-
$reflection = new \ReflectionClass($loader);
161-
$prop = $reflection->getProperty('prefixDirsPsr4');
162-
$prop->setAccessible(true);
163-
$currentValue = $prop->getValue($loader);
164-
$currentValue['Symfony\\Bridge\\PhpUnit\\'] = [realpath(__DIR__.'/../..')];
165-
$prop->setValue($loader, $currentValue);
166-
}
167-
}
168-
}
169-
170155
return [
171156
'not_from_vendors_file' => [Deprecation::TYPE_SELF, '', 'MyClass1', __FILE__],
172157
'nonexistent_file' => [Deprecation::TYPE_UNDETERMINED, '', 'MyClass1', 'dummy_vendor_path'],
@@ -276,8 +261,32 @@ private static function removeDir($dir)
276261
rmdir($dir);
277262
}
278263

264+
private static function doSetupBeforeClass()
265+
{
266+
foreach (get_declared_classes() as $class) {
267+
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
268+
$r = new \ReflectionClass($class);
269+
$v = \dirname(\dirname($r->getFileName()));
270+
if (file_exists($v.'/composer/installed.json')) {
271+
$loader = require $v.'/autoload.php';
272+
$reflection = new \ReflectionClass($loader);
273+
$prop = $reflection->getProperty('prefixDirsPsr4');
274+
$prop->setAccessible(true);
275+
$currentValue = $prop->getValue($loader);
276+
self::$prefixDirsPsr4[] = [$prop, $loader, $currentValue];
277+
$currentValue['Symfony\\Bridge\\PhpUnit\\'] = [realpath(__DIR__.'/../..')];
278+
$prop->setValue($loader, $currentValue);
279+
}
280+
}
281+
}
282+
}
283+
279284
private static function doTearDownAfterClass()
280285
{
286+
foreach (self::$prefixDirsPsr4 as [$prop, $loader, $prefixDirsPsr4]) {
287+
$prop->setValue($loader, $prefixDirsPsr4);
288+
}
289+
281290
self::removeDir(self::getVendorDir().'/myfakevendor');
282291
}
283292
}

src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
105105
$targetArg = $kernel->getProjectDir().'/'.$targetArg;
106106

107107
if (!is_dir($targetArg)) {
108-
throw new InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target')));
108+
throw new InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $targetArg));
109109
}
110110
}
111111

src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function testThenEmptyArrayExpression()
149149
/**
150150
* @dataProvider castToArrayValues
151151
*/
152-
public function testcastToArrayExpression($configValue, $expectedValue)
152+
public function testCastToArrayExpression($configValue, $expectedValue)
153153
{
154154
$test = $this->getTestBuilder()
155155
->castToArray()

src/Symfony/Component/Console/Tests/TerminalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function test()
6060
$this->assertSame(60, $terminal->getHeight());
6161
}
6262

63-
public function test_zero_values()
63+
public function testZeroValues()
6464
{
6565
putenv('COLUMNS=0');
6666
putenv('LINES=0');

src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php

Lines changed: 3 additions & 179B 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ interface EventSubscriberInterface
4040
* * ['eventName' => ['methodName', $priority]]
4141
* * ['eventName' => [['metho 5B2E dName1', $priority], ['methodName2']]]
4242
*
43+
* The code must not depend on runtime state as it will only be called at compile time.
44+
* All logic depending on runtime state must be put into the individual methods handling the events.
45+
*
4346
* @return array The event names to listen to
4447
*/
4548
public static function getSubscribedEvents();

0 commit comments

Comments
 (0)
0