1616use Symfony \Component \Cache \Adapter \ArrayAdapter ;
1717use Symfony \Component \Cache \Adapter \NullAdapter ;
1818use Symfony \Component \Cache \Adapter \PhpArrayAdapter ;
19- use Symfony \Component \Serializer \Mapping \Factory \CacheClassMetadataFactory ;
2019use Symfony \Component \Serializer \Mapping \Loader \XmlFileLoader ;
2120use Symfony \Component \Serializer \Mapping \Loader \YamlFileLoader ;
2221
2322class 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