Skip to content

Commit e114ef5

Browse files
Merge branch '4.0'
* 4.0: [Bridge\PhpUnit] Turn "preserveGlobalState" to false by default, revert "Blacklist" removal bumped Symfony version to 3.4.0 bumped Symfony version to 4.0.0 updated VERSION for 4.0.0-RC1 updated CHANGELOG for 4.0.0-RC1 updated VERSION for 3.4.0-RC1 updated CHANGELOG for 3.4.0-RC1
2 parents c37b6be + 70c000c commit e114ef5

File tree

5 files changed

+68
-60
lines changed

5 files changed

+68
-60
lines changed

CHANGELOG-4.0.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,42 @@ in 4.0 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.0.0...v4.0.1
99

10+
* 4.0.0-RC1 (2017-11-21)
11+
12+
* bug #25077 [Bridge/Twig] Let getFlashes starts the session (MatTheCat)
13+
* bug #25082 [HttpKernel] Disable container inlining when legacy inlining has been used (nicolas-grekas)
14+
* bug #25022 [Filesystem] Updated Filesystem::makePathRelative (inso)
15+
* bug #25072 [Bridge/PhpUnit] Remove trailing "\n" from ClockMock::microtime(false) (joky)
16+
* bug #25069 [Debug] Fix undefined variable $lightTrace (nicolas-grekas)
17+
* bug #25053 [Serializer] Fixing PropertyNormalizer supports parent properties (Christopher Hertel)
18+
* bug #25055 [DI] Analyze setter-circular deps more precisely (nicolas-grekas)
19+
* feature #25056 [Bridge/PhpUnit] Sync the bridge version installed in vendor/ and in phpunit clone (nicolas-grekas)
20+
* bug #25048 Allow EnumNode name to be null (MatTheCat)
21+
* bug #25045 [SecurityBundle] Don't trigger auto-picking notice if provider is set per listener (chalasr)
22+
* bug #25033 [FrameworkBundle] Dont create empty bundles directory by default (ro0NL)
23+
* bug #25037 [DI] Skip hot_path tag for deprecated services as their class might also be (nicolas-grekas)
24+
* bug #25038 [Cache] Memcached options should ignore "lazy" (nicolas-grekas)
25+
* bug #25014 Move deprecation under use statements (greg0ire)
26+
* bug #25030 [Console] Fix ability to disable lazy commands (chalasr)
27+
* bug #25032 [Bridge\PhpUnit] Disable broken auto-require mechanism of phpunit (nicolas-grekas)
28+
* bug #25016 [HttpKernel] add type-hint for the requestType (Simperfit)
29+
* bug #25027 [FrameworkBundle] Hide server:log command based on deps (sroze)
30+
* bug #24991 [DependencyInjection] Single typed argument can be applied on multiple parameters (nicolas-grekas, sroze)
31+
* bug #24983 [Validator] enter the context in which to validate (xabbuh)
32+
* bug #24956 Fix ambiguous pattern (weltling)
33+
* bug #24732 [DependencyInjection] Prevent service:method factory notation in PHP config (vudaltsov)
34+
* bug #24979 [HttpKernel] remove services resetter even when it's an alias (xabbuh)
35+
* bug #24972 [HttpKernel] Fix service arg resolver for controllers as array callables (sroze, nicolas-grekas)
36+
* bug #24971 [FrameworkBundle] Empty event dispatcher earlier in CacheClearCommand (nicolas-grekas)
37+
* security #24995 Validate redirect targets using the session cookie domain (nicolas-grekas)
38+
* security #24994 Prevent bundle readers from breaking out of paths (xabbuh)
39+
* security #24993 Ensure that submitted data are uploaded files (xabbuh)
40+
* security #24992 Namespace generated CSRF tokens depending of the current scheme (dunglas)
41+
* bug #24975 [DomCrawler] Type fix Crawler:: discoverNamespace() (VolCh)
42+
* bug #24954 [DI] Fix dumping with custom base class (nicolas-grekas)
43+
* bug #24952 [HttpFoundation] Fix session-related BC break (nicolas-grekas, sroze)
44+
* bug #24943 [FrameworkBundle] Wire the translation.reader service instead of deprecated translation.loader in commands (ogizanagi)
45+
1046
* 4.0.0-BETA4 (2017-11-12)
1147

1248
* bug #24874 [TwigBridge] Fixed the .form-check-input class in the bs4 templates (vudaltsov)

src/Symfony/Bridge/PhpUnit/Blacklist.php

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use PHPUnit\Framework\AssertionFailedError;
1616
use PHPUnit\Framework\TestCase;
1717
use PHPUnit\Framework\TestSuite;
18+
use PHPUnit\Util\Blacklist;
1819
use Symfony\Bridge\PhpUnit\ClockMock;
1920
use Symfony\Bridge\PhpUnit\DnsMock;
2021

@@ -45,6 +46,14 @@ class SymfonyTestsListenerTrait
4546
*/
4647
public function __construct(array $mockedNamespaces = array())
4748
{
49+
if (class_exists('PHPUnit_Util_Blacklist')) {
50+
\PHPUnit_Util_Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\SymfonyTestsListener'] = 1;
51+
\PHPUnit_Util_Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListener'] = 1;
52+
} else {
53+
Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\SymfonyTestsListener'] = 1;
54+
Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListener'] = 1;
55+
}
56+
4857
foreach ($mockedNamespaces as $type => $namespaces) {
4958
if (!is_array($namespaces)) {
5059
$namespaces = array($namespaces);
@@ -82,7 +91,7 @@ public function globalListenerDisabled()
8291

8392
public function startTestSuite($suite)
8493
{
85-
if (class_exists('PHPUnit_Util_Test', false)) {
94+
if (class_exists('PHPUnit_Util_Blacklist', false)) {
8695
$Test = 'PHPUnit_Util_Test';
8796
} else {
8897
$Test = 'PHPUnit\Util\Test';
@@ -125,6 +134,10 @@ public function startTestSuite($suite)
125134
if (in_array('dns-sensitive', $groups, true)) {
126135
DnsMock::register($test->getName());
127136
}
137+
} elseif (!($test instanceof \PHPUnit_Framework_TestCase || $test instanceof TestCase)) {
138+
// no-op
139+
} elseif (null === $Test::getPreserveGlobalStateSettings(get_class($test), $test->getName(false))) {
140+
$test->setPreserveGlobalState(false);
128141
}
129142
}
130143
}
@@ -135,6 +148,8 @@ public function startTestSuite($suite)
135148
|| isset($this->wasSkipped[$suiteName]['*'])
136149
|| isset($this->wasSkipped[$suiteName][$test->getName()])) {
137150
$skipped[] = $test;
151+
} elseif (null === $Test::getPreserveGlobalStateSettings(get_class($test), $test->getName(false))) {
152+
$test->setPreserveGlobalState(false);
138153
}
139154
}
140155
$suite->setTests($skipped);
@@ -169,7 +184,7 @@ public function startTest($test)
169184
putenv('SYMFONY_DEPRECATIONS_SERIALIZE='.$this->runsInSeparateProcess);
170185
}
171186

172-
if (class_exists('PHPUnit_Util_Test', false)) {
187+
if (class_exists('PHPUnit_Util_Blacklist', false)) {
173188
$Test = 'PHPUnit_Util_Test';
174189
$AssertionFailedError = 'PHPUnit_Framework_AssertionFailedError';
175190
} else {
@@ -215,7 +230,7 @@ public function addWarning($test, $e, $time)
215230

216231
public function endTest($test, $time)
217232
{
218-
if (class_exists('PHPUnit_Util_Test', false)) {
233+
if (class_exists('PHPUnit_Util_Blacklist', false)) {
219234
$Test = 'PHPUnit_Util_Test';
220235
$BaseTestRunner = 'PHPUnit_Runner_BaseTestRunner';
221236
$Warning = 'PHPUnit_Framework_Warning';

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
9898
define('PHPUNIT_COMPOSER_INSTALL', __DIR__.'/vendor/autoload.php');
9999
require PHPUNIT_COMPOSER_INSTALL;
100100
101+
if (!class_exists('SymfonyBlacklistPhpunit', false)) {
102+
class SymfonyBlacklistPhpunit {}
103+
}
104+
if (class_exists('PHPUnit_Util_Blacklist')) {
105+
PHPUnit_Util_Blacklist::$blacklistedClassNames['SymfonyBlacklistPhpunit'] = 1;
106+
PHPUnit_Util_Blacklist::$blacklistedClassNames['SymfonyBlacklistSimplePhpunit'] = 1;
107+
} else {
108+
PHPUnit\Util\Blacklist::$blacklistedClassNames['SymfonyBlacklistPhpunit'] = 1;
109+
PHPUnit\Util\Blacklist::$blacklistedClassNames['SymfonyBlacklistSimplePhpunit'] = 1;
110+
}
111+
101112
Symfony\Bridge\PhpUnit\TextUI\Command::main();
102113

103114
EOPHP
@@ -216,6 +227,9 @@ if ($components) {
216227
}
217228
}
218229
} elseif (!isset($argv[1]) || 'install' !== $argv[1] || file_exists('install')) {
230+
if (!class_exists('SymfonyBlacklistSimplePhpunit', false)) {
231+
class SymfonyBlacklistSimplePhpunit {}
232+
}
219233
array_splice($argv, 1, 0, array('--colors=always'));
220234
$_SERVER['argv'] = $argv;
221235
$_SERVER['argc'] = ++$argc;

src/Symfony/Bridge/PhpUnit/bootstrap.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
use Doctrine\Common\Annotations\AnnotationRegistry;
1313
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
1414

15-
// Replace the native phpunit Blacklist, it's a broken artifact from the past
16-
if (!class_exists('Symfony\Bridge\PhpUnit\Blacklist', false)) {
17-
require_once __DIR__.'/Blacklist.php';
18-
}
19-
2015
// Detect if we need to serialize deprecations to a file.
2116
if ($file = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) {
2217
DeprecationErrorHandler::collectDeprecations($file);

0 commit comments

Comments
 (0)