8000 minor #36946 [FrameworkBundle] Removed detection of Serializer < 3.2 … · symfony/symfony@4f40da5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4f40da5

Browse files
committed
minor #36946 [FrameworkBundle] Removed detection of Serializer < 3.2 (derrabus)
This PR was merged into the 3.4 branch. Discussion ---------- [FrameworkBundle] Removed detection of Serializer < 3.2 | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A The test that is changed here contains detection logic for Serializer versions prior 3.2. However, accoring to FrameworkBundle's composer.json, we need at least Serializer 3.3, so that logic is obsolete. I came across this piece of code because on the 5.1 branch, this test is actually skipped because the `use` statement for `CacheClassMetadataFactory` is missing there. Commits ------- 9badd71 [FrameworkBundle] Removed detection of Serializer < 3.2
2 parents b6c43b6 + 9badd71 commit 4f40da5

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,13 @@
1616
use Symfony\Component\Cache\Adapter\ArrayAdapter;
1717
use Symfony\Component\Cache\Adapter\NullAdapter;
1818
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
19-
use Symfony\Component\Serializer\Mapping\Factory\CacheClassMetadataFactory;
2019
use Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader;
2120
use Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader;
2221

2322
class SerializerCacheWarmerTest extends TestCase
2423
{
2524
public function testWarmUp()
2625
{
27-
if (!class_exists(CacheClassMetadataFactory::class) || !method_exists(XmlFileLoader::class, 'getMappedClasses') || !method_exists(YamlFileLoader::class, 'getMappedClasses')) {
28-
$this->markTestSkipped('The Serializer default cache warmer has been introduced in the Serializer Component version 3.2.');
29-
}
30-
3126
$loaders = [
3227
new XmlFileLoader(__DIR__.'/../Fixtures/Serialization/Resources/person.xml'),
3328
new YamlFileLoader(__DIR__.'/../Fixtures/Serialization/Resources/author.yml'),
@@ -58,10 +53,6 @@ public function testWarmUp()
5853

5954
public function testWarmUpWithoutLoader()
6055
{
61-
if (!class_exists(CacheClassMetadataFactory::class) || !method_exists(XmlFileLoader::class, 'getMappedClasses') || !method_exists(YamlFileLoader::class, 'getMappedClasses')) {
62-
$this->markTestSkipped('The Serializer default cache warmer has been introduced in the Serializer Component version 3.2.');
63-
}
64-
6556
$file = sys_get_temp_dir().'/cache-serializer-without-loader.php';
6657
@unlink($file);
6758

@@ -84,10 +75,6 @@ public function testWarmUpWithoutLoader()
8475
*/
8576
public function testClassAutoloadException()
8677
{
87-
if (!class_exists(CacheClassMetadataFactory::class) || !method_exists(XmlFileLoader::class, 'getMappedClasses') || !method_exists(YamlFileLoader::class, 'getMappedClasses')) {
88-
$this->markTestSkipped('The Serializer default cache warmer has been introduced in the Serializer Component version 3.2.');
89-
}
90-
9178
$this->assertFalse(class_exists($mappedClass = 'AClassThatDoesNotExist_FWB_CacheWarmer_SerializerCacheWarmerTest', false));
9279

9380
$warmer = new SerializerCacheWarmer([new YamlFileLoader(__DIR__.'/../Fixtures/Serialization/Resources/does_not_exist.yaml')], tempnam(sys_get_temp_dir(), __FUNCTION__), new ArrayAdapter());
@@ -112,10 +99,6 @@ public function testClassAutoloadExceptionWithUnrelatedException()
11299
$this->expectException(\DomainException::class);
113100
$this->expectExceptionMessage('This exception should not be caught by the warmer.');
114101

115-
if (!class_exists(CacheClassMetadataFactory::class) || !method_exists(XmlFileLoader::class, 'getMappedClasses') || !method_exists(YamlFileLoader::class, 'getMappedClasses')) {
116-
$this->markTestSkipped('The Serializer default cache warmer has been introduced in the Serializer Component version 3.2.');
117-
}
118-
119102
$this->assertFalse(class_exists($mappedClass = 'AClassThatDoesNotExist_FWB_CacheWarmer_SerializerCacheWarmerTest', false));
120103

121104
$warmer = new SerializerCacheWarmer([new YamlFileLoader(__DIR__.'/../Fixtures/Serialization/Resources/does_not_exist.yaml')], tempnam(sys_get_temp_dir(), __FUNCTION__), new ArrayAdapter());

0 commit comments

Comments
 (0)
0