Skip to content

Commit f7cfbe3

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Add Tagalog translations for validator messages 94, 95, 96 and 99 PHPUnit's assertContains() performs strict comparisons now. [ClassLoader][Routing] Fix namespace parsing on php 8. Fix deprecated libxml_disable_entity_loader Made reference to PHPUnit\Util\XML::loadfile php5-compatible. [Validator] Add missing translations for german and vietnamese Modernized deprecated PHPUnit assertion calls [Console] The message of "class not found" errors has changed in php 8. The PHPUnit\Util\XML class has been removed in PHPUnit 9.3. [Console] Make sure we pass a numeric array of arguments to call_user_func_array(). [Serializer] Fix that it will never reach DOMNode [Validator] sync translations [VarDumper] Improve previous fix on light array coloration [Cache] Fix #37667
2 parents d42f9be + 8ee84f9 commit f7cfbe3

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

Tests/DataCollector/ConfigDataCollectorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public function testCollect()
3030
$this->assertSame('test', $c->getEnv());
3131
$this->assertTrue($c->isDebug());
3232
$this->assertSame('config', $c->getName());
33-
$this->assertRegExp('~^'.preg_quote($c->getPhpVersion(), '~').'~', PHP_VERSION);
34-
$this->assertRegExp('~'.preg_quote((string) $c->getPhpVersionExtra(), '~').'$~', PHP_VERSION);
33+
$this->assertMatchesRegularExpression('~^'.preg_quote($c->getPhpVersion(), '~').'~', PHP_VERSION);
34+
$this->assertMatchesRegularExpression('~'.preg_quote((string) $c->getPhpVersionExtra(), '~').'$~', PHP_VERSION);
3535
$this->assertSame(PHP_INT_SIZE * 8, $c->getPhpArchitecture());
3636
$this->assertSame(class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a', $c->getPhpIntlLocale());
3737
$this->assertSame(date_default_timezone_get(), $c->getPhpTimezone());

Tests/DataCollector/RequestDataCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function testCollect()
5151
$this->assertEquals(['name' => 'foo'], $c->getRouteParams());
5252
$this->assertSame([], $c->getSessionAttributes());
5353
$this->assertSame('en', $c->getLocale());
54-
$this->assertContains(__FILE__, $attributes->get('resource'));
54+
$this->assertContainsEquals(__FILE__, $attributes->get('resource'));
5555
$this->assertSame('stdClass', $attributes->get('object')->getType());
5656

5757
$this->assertInstanceOf('Symfony\Component\HttpFoundation\ParameterBag', $c->getResponseHeaders());

Tests/HttpCache/HttpCacheTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ public function testAssignsDefaultTtlWhenResponseHasNoFreshnessInformation()
654654
$this->assertTraceContains('miss');
655655
$this->assertTraceContains('store');
656656
$this->assertEquals('Hello World', $this->response->getContent());
657-
$this->assertRegExp('/s-maxage=10/', $this->response->headers->get('Cache-Control'));
657+
$this->assertMatchesRegularExpression('/s-maxage=10/', $this->response->headers->get('Cache-Control'));
658658

659659
$this->cacheConfig['default_ttl'] = 10;
660660
$this->request('GET', '/');
@@ -663,7 +663,7 @@ public function testAssignsDefaultTtlWhenResponseHasNoFreshnessInformation()
663663
$this->assertTraceContains('fresh');
664664
$this->assertTraceNotContains('store');
665665
$this->assertEquals('Hello World', $this->response->getContent());
666-
$this->assertRegExp('/s-maxage=10/', $this->response->headers->get('Cache-Control'));
666+
$this->assertMatchesRegularExpression('/s-maxage=10/', $this->response->headers->get('Cache-Control'));
667667
}
668668

669669
public function testAssignsDefaultTtlWhenResponseHasNoFreshnessInformationAndAfterTtlWasExpired()
@@ -676,15 +676,15 @@ public function testAssignsDefaultTtlWhenResponseHasNoFreshnessInformationAndAft
676676
$this->assertTraceContains('miss');
677677
$this->assertTraceContains('store');
678678
$this->assertEquals('Hello World', $this->response->getContent());
679-
$this->assertRegExp('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
679+
$this->assertMatchesRegularExpression('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
680680

681681
$this->request('GET', '/');
682682
$this->assertHttpKernelIsNotCalled();
683683
$this->assertEquals(200, $this->response->getStatusCode());
684684
$this->assertTraceContains('fresh');
685685
$this->assertTraceNotContains('store');
686686
$this->assertEquals('Hello World', $this->response->getContent());
687-
$this->assertRegExp('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
687+
$this->assertMatchesRegularExpression('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
688688

689689
// expires the cache
690690
$values = $this->getMetaStorageValues();
@@ -704,7 +704,7 @@ public function testAssignsDefaultTtlWhenResponseHasNoFreshnessInformationAndAft
704704
$this->assertTraceContains('invalid');
705705
$this->assertTraceContains('store');
706706
$this->assertEquals('Hello World', $this->response->getContent());
707-
$this->assertRegExp('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
707+
$this->assertMatchesRegularExpression('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
708708

709709
$this->setNextResponse();
710710

@@ -714,7 +714,7 @@ public function testAssignsDefaultTtlWhenResponseHasNoFreshnessInformationAndAft
714714
$this->assertTraceContains('fresh');
715715
$this->assertTraceNotContains('store');
716716
$this->assertEquals('Hello World', $this->response->getContent());
717-
$this->assertRegExp('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
717+
$this->assertMatchesRegularExpression('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
718718
}
719719

720720
public function testAssignsDefaultTtlWhenResponseHasNoFreshnessInformationAndAfterTtlWasExpiredWithStatus304()
@@ -727,7 +727,7 @@ public function testAssignsDefaultTtlWhenResponseHasNoFreshnessInformationAndAft
727727
$this->assertTraceContains('miss');
728728
$this->assertTraceContains('store');
729729
$this->assertEquals('Hello World', $this->response->getContent());
730-
$this->assertRegExp('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
730+
$this->assertMatchesRegularExpression('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
731731

732732
$this->request('GET', '/');
733733
$this->assertHttpKernelIsNotCalled();
@@ -755,15 +755,15 @@ public function testAssignsDefaultTtlWhenResponseHasNoFreshnessInformationAndAft
755755
$this->assertTraceContains('store');
756756
$this->assertTraceNotContains('miss');
757757
$this->assertEquals('Hello World', $this->response->getContent());
758-
$this->assertRegExp('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
758+
$this->assertMatchesRegularExpression('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
759759

760760
$this->request('GET', '/');
761761
$this->assertHttpKernelIsNotCalled();
762762
$this->assertEquals(200, $this->response->getStatusCode());
763763
$this->assertTraceContains('fresh');
764764
$this->assertTraceNotContains('store');
765765
$this->assertEquals('Hello World', $this->response->getContent());
766-
$this->assertRegExp('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
766+
$this->assertMatchesRegularExpression('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
767767
}
768768

769769
public function testDoesNotAssignDefaultTtlWhenResponseHasMustRevalidateDirective()
@@ -776,7 +776,7 @@ public function testDoesNotAssignDefaultTtlWhenResponseHasMustRevalidateDirectiv
776776
$this->assertEquals(200, $this->response->getStatusCode());
777777
$this->assertTraceContains('miss');
778778
$this->assertTraceNotContains('store');
779-
$this->assertNotRegExp('/s-maxage/', $this->response->headers->get('Cache-Control'));
779+
$this->assertDoesNotMatchRegularExpression('/s-maxage/', $this->response->headers->get('Cache-Control'));
780780
$this->assertEquals('Hello World', $this->response->getContent());
781781
}
782782

Tests/HttpCache/HttpCacheTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ public function assertTraceContains($trace)
9191
$traces = $this->cache->getTraces();
9292
$traces = current($traces);
9393

94-
$this->assertRegExp('/'.$trace.'/', implode(', ', $traces));
94+
$this->assertMatchesRegularExpression('/'.$trace.'/', implode(', ', $traces));
9595
}
9696

9797
public function assertTraceNotContains($trace)
9898
{
9999
$traces = $this->cache->getTraces();
100100
$traces = current($traces);
101101

102-
$this->assertNotRegExp('/'.$trace.'/', implode(', ', $traces));
102+
$this->assertDoesNotMatchRegularExpression('/'.$trace.'/', implode(', ', $traces));
103103
}
104104

105105
public function assertExceptionsAreCaught()

Tests/KernelTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ public function testInitializeContainerClearsOldContainers()
9999
$containerDir = __DIR__.'/Fixtures/var/cache/custom/'.substr(\get_class($kernel->getContainer()), 0, 16);
100100
$this->assertTrue(unlink(__DIR__.'/Fixtures/var/cache/custom/TestsSymfony_Component_HttpKernel_Tests_CustomProjectDirKernelCustomDebugContainer.php.meta'));
101101
$this->assertFileExists($containerDir);
102-
$this->assertFileNotExists($containerDir.'.legacy');
102+
$this->assertFileDoesNotExist($containerDir.'.legacy');
103103

104104
$kernel = new CustomProjectDirKernel(function ($container) { $container->register('foo', 'stdClass')->setPublic(true); });
105105
$kernel->boot();
106106

107107
$this->assertFileExists($containerDir);
108108
$this->assertFileExists($containerDir.'.legacy');
109109

110-
$this->assertFileNotExists($legacyContainerDir);
111-
$this->assertFileNotExists($legacyContainerDir.'.legacy');
110+
$this->assertFileDoesNotExist($legacyContainerDir);
111+
$this->assertFileDoesNotExist($legacyContainerDir.'.legacy');
112112
}
113113

114114
public function testBootInitializesBundlesAndContainer()

Tests/Profiler/FileProfilerStorageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ public function testStatusCode()
293293

294294
$tokens = $this->storage->find('', '', 10, '');
295295
$this->assertCount(2, $tokens);
296-
$this->assertContains($tokens[0]['status_code'], [200, 404]);
297-
$this->assertContains($tokens[1]['status_code'], [200, 404]);
296+
$this->assertContains((int) $tokens[0]['status_code'], [200, 404]);
297+
$this->assertContains((int) $tokens[1]['status_code'], [200, 404]);
298298
}
299299

300300
public function testMultiRowIndexFile()

0 commit comments

Comments
 (0)