Repository: symfony/symfony
File: src/Symfony/Component/JsonStreamer/Tests/Write/StreamWriterGeneratorTest.php (PHP)

Code before:
        $this->assertStringEqualsFile(
            \sprintf('%s/Fixtures/stream_writer/%s.php', \dirname(__DIR__), $fixture),
            file_get_contents($generator->generate($type)),
        );
    }

    /**
     * @return iterable<array{0: string, 1: Type, 2?: PropertyMetadataLoaderInterface}>
     */
    public static function generatedStreamWriterDataProvider(): iterable
    {
        yield ['scalar', Type::int()];
        yield ['null', Type::null()];
        yield ['bool', Type::bool()];
        yield ['mixed', Type::mixed()];
        yield ['backed_enum', Type::enum(DummyBackedEnum::class, Type::string())];
        yield ['nullable_backed_enum', Type::nullable(Type::enum(DummyBackedEnum::class, Type::string()))];

        yield ['list', Type::list()];
        yield ['bool_list', Type::list(Type::bool())];
        yield ['null_list', Type::list(Type::null())];
        yield ['object_list', Type::list(Type::object(DummyWithNameAttributes::class))];
        yield ['nullable_object_list', Type::nullable(Type::list(Type::object(DummyWithNameAttributes::class)))];
        yield ['nested_list', Type::list(Type::object(DummyWithArray::class))];
        yield ['double_nested_list', Type::list(Type::object(DummyWithNestedArray::class))];
        yield ['object_with_nested_self', Type::object(DummyWithNestedDummies::class)];
        yield ['object_with_nested_dict_self', Type::object(DummyWithNestedDictDummies::class)];

        yield ['dict', Type::dict()];
        yield ['object_dict', Type::dict(Type::object(DummyWithNameAttributes::class))];
        yield ['nullable_object_dict', Type::nullable(Type::dict(Type::object(DummyWithNameAttributes::class)))];

        yield ['iterable', Type::iterable()];
        yield ['object_iterable', Type::iterable(Type::object(ClassicDummy::class))];

        yield ['object', Type::object(DummyWithNameAttributes::class)];
        yield ['nullable_object', Type::nullable(Type::object(DummyWithNameAttributes::class))];
        yield ['object_in_object', Type::object(DummyWithOtherDummies::class)];
        yield ['object_with_value_transformer', Type::object(DummyWithValueTransformerAttributes::class)];
        yield ['self_referencing_object', Type::object(SelfReferencingDummy::class)];
        yield ['self_referencing_object_list', Type::object(SelfReferencingDummyList::class)];
        yield ['object_with_dollar_named_properties', Type::object(DummyWithDollarNamedProperties::class)];
        yield ['object_with_synthetic_properties', Type::object(DummyWithSyntheticProperties::class), new SyntheticPropertyMetadataLoader()];

        yield ['union', Type::union(Type::int(), Type::list(Type::enum(DummyBackedEnum::class)), Type::object(DummyWithNameAttributes::class))];
        yield ['object_with_union', Type::object(DummyWithUnionProperties::class)];
    }

    public function testDoNotSupportIntersectionType()
    {
        $generator = new StreamWriterGenerator(new PropertyMetadataLoader(TypeResolver::create()), $this->streamWritersDir);

Review comment (suggestion):
```suggestion
        yield ['object_with_nested_list_self', Type::object(DummyWithNestedDummies::class)];
```

Code after:

        $this->assertStringEqualsFile(
            \sprintf('%s/Fixtures/stream_writer/%s.php', \dirname(__DIR__), $fixture),
            file_get_contents($generator->generate($type)),
        );
    }

    /**
     * @return iterable<array{0: string, 1: Type, 2?: PropertyMetadataLoaderInterface}>
     */
    public static function generatedStreamWriterDataProvider(): iterable
    {
        yield ['scalar', Type::int()];
        yield ['null', Type::null()];
        yield ['bool', Type::bool()];
        yield ['mixed', Type::mixed()];
        yield ['backed_enum', Type::enum(DummyBackedEnum::class, Type::string())];
        yield ['nullable_backed_enum', Type::nullable(Type::enum(DummyBackedEnum::class, Type::string()))];

        yield ['list', Type::list()];
        yield ['bool_list', Type::list(Type::bool())];
        yield ['null_list', Type::list(Type::null())];
        yield ['object_list', Type::list(Type::object(DummyWithNameAttributes::class))];
        yield ['nullable_object_list', Type::nullable(Type::list(Type::object(DummyWithNameAttributes::class)))];
        yield ['nested_list', Type::list(Type::object(DummyWithArray::class))];
        yield ['double_nested_list', Type::list(Type::object(DummyWithNestedArray::class))];
        yield ['object_with_nested_list_self', Type::object(DummyWithNestedListDummies::class)];
        yield ['object_with_nested_dict_self', Type::object(DummyWithNestedDictDummies::class)];

        yield ['dict', Type::dict()];
        yield ['object_dict', Type::dict(Type::object(DummyWithNameAttributes::class))];
        yield ['nullable_object_dict', Type::nullable(Type::dict(Type::object(DummyWithNameAttributes::class)))];

        yield ['iterable', Type::iterable()];
        yield ['object_iterable', Type::iterable(Type::object(ClassicDummy::class))];

        yield ['object', Type::object(DummyWithNameAttributes::class)];
        yield ['nullable_object', Type::nullable(Type::object(DummyWithNameAttributes::class))];
        yield ['object_in_object', Type::object(DummyWithOtherDummies::class)];
        yield ['object_with_value_transformer', Type::object(DummyWithValueTransformerAttributes::class)];
        yield ['self_referencing_object', Type::object(SelfReferencingDummy::class)];
        yield ['self_referencing_object_list', Type::object(SelfReferencingDummyList::class)];
        yield ['self_referencing_object_dict', Type::object(SelfReferencingDummyDict::class)];
        yield ['object_with_dollar_named_properties', Type::object(DummyWithDollarNamedProperties::class)];
        yield ['object_with_synthetic_properties', Type::object(DummyWithSyntheticProperties::class), new SyntheticPropertyMetadataLoader()];

        yield ['union', Type::union(Type::int(), Type::list(Type::enum(DummyBackedEnum::class)), Type::object(DummyWithNameAttributes::class))];
        yield ['object_with_union', Type::object(DummyWithUnionProperties::class)];
    }

    public function testDoNotSupportIntersectionType()