@@ -25,12 +25,10 @@ protected function getMakerClass(): string
2525 public function getTestDetails (): \Generator
2626 {
2727 yield 'it_makes_serializer_encoder ' => [$ this ->createMakerTest ()
28- // serializer-pack 1.1 requires symfony/property-info >= 5.4
29- // adding symfony/serializer-pack:* as an extra depends allows
30- // us to use serializer-pack < 1.1 which does not conflict with
31- // property-info < 5.4. E.g. Symfony 5.3 tests. See PR 1063
32- ->addExtraDependencies ('symfony/serializer-pack:* ' )
3328 ->run (function (MakerTestRunner $ runner ) {
29+ if (70000 >= $ runner ->getSymfonyVersion ()) {
30+ $ this ->markTestSkipped ('Legacy Symfony 6.4 Test ' );
31+ }
3432 $ runner ->runMaker (
3533 [
3634 // encoder class name
@@ -39,6 +37,33 @@ public function getTestDetails(): \Generator
3937 'foobar ' ,
4038 ]
4139 );
40+
41+ self ::assertStringContainsString (
42+ needle: 'public function decode(string $data, string $format, array $context = []): mixed ' ,
43+ haystack: file_get_contents ($ runner ->getPath ('src/Serializer/FooBarEncoder.php ' ))
44+ );
45+ }),
46+ ];
47+
48+ /* @legacy - Remove when MakerBundle no longer supports Symfony 6.4 */
49+ yield 'it_makes_serializer_encoder_legacy ' => [$ this ->createMakerTest ()
50+ ->run (function (MakerTestRunner $ runner ) {
51+ if (70000 < $ runner ->getSymfonyVersion ()) {
52+ $ this ->markTestSkipped ('Legacy Symfony 6.4 Test ' );
53+ }
54+ $ runner ->runMaker (
55+ [
56+ // encoder class name
57+ 'FooBarEncoder ' ,
58+ // encoder format
59+ 'foobar ' ,
60+ ]
61+ );
62+
63+ self ::assertStringNotContainsString (
64+ needle: 'public function decode(string $data, string $format, array $context = []): mixed ' ,
65+ haystack: file_get_contents ($ runner ->getPath ('src/Serializer/FooBarEncoder.php ' ))
66+ );
4267 }),
4368 ];
4469 }
0 commit comments