8000 Merge branch '4.4' into 5.1 · symfony/symfony@298422c · GitHub
[go: up one dir, main page]

Skip to content

Commit 298422c

Browse files
Merge branch '4.4' into 5.1
* 4.4: [PhpUnitBridge] fix replaying skipped tests Switch nightly run to 8.0snapshot
2 parents f0d9eeb + 703497d commit 298422c

File tree

3 files changed

+34
-23
lines changed

3 files changed

+34
-23
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ matrix:
2828
env: deps=high
2929
- php: 7.4
3030
env: deps=low
31-
- php: nightly
31+
- php: 8.0snapshot
3232
services: [memcached]
3333
fast_finish: true
3434
allow_failures:
35-
- php: nightly
35+
- php: 8.0snapshot
3636
services: [memcached]
3737

3838
cache:
@@ -140,7 +140,7 @@ before_install:
140140
echo session.gc_probability = 0 >> $INI
141141
echo opcache.enable_cli = 1 >> $INI
142142
echo apc.enable_cli = 1 >> $INI
143-
if [[ $PHP != nightly ]]; then
143+
if [[ $PHP != 8.* ]]; then
144144
echo extension = memcached.so >> $INI
145145
fi
146146
done
@@ -156,7 +156,7 @@ before_install:
156156
if ! php --ri sodium > /dev/null; then
157157
tfold ext.libsodium tpecl libsodium sodium.so $INI
158158
fi
159-
if [[ $PHP = nightly ]]; then
159+
if [[ $PHP = 8.* ]]; then
160160
tfold ext.memcached tpecl memcached-3.1.5 memcached.so $INI
161161
else
162162
tfold ext.mongodb tpecl mongodb-1.6.16 mongodb.so $INI
@@ -234,7 +234,7 @@ install:
234234
235235
- |
236236
# Set composer's platform to php 7.4 if we're on php 8.
237-
if [[ $PHP = nightly ]]; then
237+
if [[ $PHP = 8.* ]]; then
238238
composer config platform.php 7.4.99
239239
export SYMFONY_DEPRECATIONS_HELPER=max[total]=999
240240
fi

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

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function startTestSuite($suite)
123123
$suiteName = $suite->getName();
124124

125125
foreach ($suite->tests() as $test) {
126-
if (!($test instanceof \PHPUnit\Framework\TestCase || $test instanceof TestCase)) {
126+
if (!($test instanceof \PHPUnit_Framework_TestCase || $test instanceof TestCase)) {
127127
continue;
128128
}
129129
if (null === Test::getPreserveGlobalStateSettings(\get_class($test), $test->getName(false))) {
@@ -158,7 +158,7 @@ public function startTestSuite($suite)
158158
$testSuites = [$suite];
159159
for ($i = 0; isset($testSuites[$i]); ++$i) {
160160
foreach ($testSuites[$i]->tests() as $test) {
161-
if ($test instanceof TestSuite) {
161+
if ($test instanceof \PHPUnit_Framework_TestSuite || $test instanceof TestSuite) {
162162
if (!class_exists($test->getName(), false)) {
163163
$testSuites[] = $test;
164164
continue;
@@ -174,12 +174,19 @@ public function startTestSuite($suite)
174174
}
175175
}
176176
} elseif (2 === $this->state) {
177+
$suites = [$suite];
177178
$skipped = [];
178-
foreach ($suite->tests() as $test) {
179-
if (!($test instanceof \< 8000 span class=pl-v>PHPUnit\Framework\TestCase || $test instanceof TestCase)
180-
|| isset($this->wasSkipped[$suiteName]['*'])
181-
|| isset($this->wasSkipped[$suiteName][$test->getName()])) {
182-
$skipped[] = $test;
179+
while ($s = array_shift($suites)) {
180+
foreach ($s->tests() as $test) {
181+
if ($test instanceof \PHPUnit_Framework_TestSuite || $test instanceof TestSuite) {
182+
$suites[] = $test;
183+
continue
184+
}
185+
if (($test instanceof \PHPUnit_Framework_TestCase || $test instanceof TestCase)
186+
&& isset($this->wasSkipped[\get_class($test)][$test->getName()])
187+
) {
188+
$skipped[] = $test;
189+
}
183190
}
184191
}
185192
$suite->setTests($skipped);
@@ -189,21 +196,13 @@ public function startTestSuite($suite)
189196
public function addSkippedTest($test, \Exception $e, $time)
190197
{
191198
if (0 < $this->state) {
192-
if ($test instanceof \PHPUnit\Framework\TestCase || $test instanceof TestCase) {
193-
$class = \get_class($test);
194-
$method = $test->getName();
195-
} else {
196-
$class = $test->getName();
197-
$method = '*';
198-
}
199-
200-
$this->isSkipped[$class][$method] = 1;
199+
$this->isSkipped[\get_class($test)][$test->getName()] = 1;
201200
}
202201
}
203202

204203
public function startTest($test)
205204
{
206-
if (-2 < $this->state && ($test instanceof \PHPUnit\Framework\TestCase || $test instanceof TestCase)) {
205+
if (-2 < $this->state && ($test instanceof \PHPUnit_Framework_TestCase || $test instanceof TestCase)) {
207206
// This event is triggered before the test is re-run in isolation
208207
if ($this->willBeIsolated($test)) {
209208
$this->runsInSeparateProcess = tempnam(sys_get_temp_dir(), 'deprec');
@@ -313,7 +312,7 @@ public function endTest($test, $time)
313312
self::$expectedDeprecations = self::$gatheredDeprecations = [];
314313
self::$previousErrorHandler = null;
315314
}
316-
if (!$this->runsInSeparateProcess && -2 < $this->state && ($test instanceof \PHPUnit\Framework\TestCase || $test instanceof TestCase)) {
315+
if (!$this->runsInSeparateProcess && -2 < $this->state && ($test instanceof \PHPUnit_Framework_TestCase || $test instanceof TestCase)) {
317316
if (\in_array('time-sensitive', $groups, true)) {
318317
ClockMock::withClockMock(false);
319318
}

src/Symfony/Component/Intl/Tests/DateFormatter/Verification/IntlDateFormatterTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ protected function setUp(): void
3030
parent::setUp();
3131
}
3232

33+
/**
34+
* @dataProvider formatProvider
35+
*/
36+
public function testFormat($pattern, $timestamp, $expected)
37+
{
38+
if (\PHP_VERSION_ID < 70105 && $timestamp instanceof \DateTimeImmutable) {
39+
$this->markTestSkipped('PHP >= 7.1.5 required for DateTimeImmutable.');
40+
}
41+
42+
parent::testFormat($pattern, $timestamp, $expected);
43+
}
44+
3345
/**
3446
* @dataProvider formatTimezoneProvider
3547
*/

0 commit comments

Comments
 (0)
0