1515use Symfony \Bundle \FrameworkBundle \Tests \TestCase ;
1616use Symfony \Component \Cache \Adapter \NullAdapter ;
1717use Symfony \Component \Cache \Adapter \PhpArrayAdapter ;
18- use Symfony \Component \Serializer \Mapping \Factory \CacheClassMetadataFactory ;
1918use Symfony \Component \Serializer \Mapping \Loader \XmlFileLoader ;
2019use Symfony \Component \Serializer \Mapping \Loader \YamlFileLoader ;
2120
2221class SerializerCacheWarmerTest extends TestCase
2322{
2423 public function testWarmUp ()
2524 {
26- if (!class_exists (CacheClassMetadataFactory::class) || !method_exists (XmlFileLoader::class, 'getMappedClasses ' ) || !method_exists (YamlFileLoader::class, 'getMappedClasses ' )) {
27- $ this ->markTestSkipped ('The Serializer default cache warmer has been introduced in the Serializer Component version 3.2. ' );
28- }
29-
3025 $ loaders = [
3126 new XmlFileLoader (__DIR__ .'/../Fixtures/Serialization/Resources/person.xml ' ),
3227 new YamlFileLoader (__DIR__ .'/../Fixtures/Serialization/Resources/author.yml ' ),
@@ -48,10 +43,6 @@ public function testWarmUp()
4843
4944 public function testWarmUpWithoutLoader ()
5045 {
51- if (!class_exists (CacheClassMetadataFactory::class) || !method_exists (XmlFileLoader::class, 'getMappedClasses ' ) || !method_exists (YamlFileLoader::class, 'getMappedClasses ' )) {
52- $ this ->markTestSkipped ('The Serializer default cache warmer has been introduced in the Serializer Component version 3.2. ' );
53- }
54-
5546 $ file = sys_get_temp_dir ().'/cache-serializer-without-loader.php ' ;
5647 @unlink ($ file );
5748
@@ -67,10 +58,6 @@ public function testWarmUpWithoutLoader()
6758 */
6859 public function testClassAutoloadException ()
6960 {
70- if (!class_exists (CacheClassMetadataFactory::class) || !method_exists (XmlFileLoader::class, 'getMappedClasses ' ) || !method_exists (YamlFileLoader::class, 'getMappedClasses ' )) {
71- $ this ->markTestSkipped ('The Serializer default cache warmer has been introduced in the Serializer Component version 3.2. ' );
72- }
73-
7461 $ this ->assertFalse (class_exists ($ mappedClass = 'AClassThatDoesNotExist_FWB_CacheWarmer_SerializerCacheWarmerTest ' , false ));
7562
7663 $ warmer = new SerializerCacheWarmer ([new YamlFileLoader (__DIR__ .'/../Fixtures/Serialization/Resources/does_not_exist.yaml ' )], tempnam (sys_get_temp_dir (), __FUNCTION__ ));
@@ -95,10 +82,6 @@ public function testClassAutoloadExceptionWithUnrelatedException()
9582 $ this ->expectException (\DomainException::class);
9683 $ this ->expectExceptionMessage ('This exception should not be caught by the warmer. ' );
9784
98- if (!class_exists (CacheClassMetadataFactory::class) || !method_exists (XmlFileLoader::class, 'getMappedClasses ' ) || !method_exists (YamlFileLoader::class, 'getMappedClasses ' )) {
99- $ this ->markTestSkipped ('The Serializer default cache warmer has been introduced in the Serializer Component version 3.2. ' );
100- }
101-
10285 $ this ->assertFalse (class_exists ($ mappedClass = 'AClassThatDoesNotExist_FWB_CacheWarmer_SerializerCacheWarmerTest ' , false ));
10386
10487 $ warmer = new SerializerCacheWarmer ([new YamlFileLoader (__DIR__ .'/../Fixtures/Serialization/Resources/does_not_exist.yaml ' )], tempnam (sys_get_temp_dir (), __FUNCTION__ ));
0 commit comments