Skip to content

[ObjectMapper] Remove deprecated LazyGhostTrait test #61191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions src/Symfony/Component/ObjectMapper/Tests/Fixtures/LazyFoo.php

This file was deleted.

9 changes: 0 additions & 9 deletions src/Symfony/Component/ObjectMapper/Tests/ObjectMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
use Symfony\Component\ObjectMapper\Tests\Fixtures\InstanceCallback\B as InstanceCallbackB;
use Symfony\Component\ObjectMapper\Tests\Fixtures\InstanceCallbackWithArguments\A as InstanceCallbackWithArgumentsA;
use Symfony\Component\ObjectMapper\Tests\Fixtures\InstanceCallbackWithArguments\B as InstanceCallbackWithArgumentsB;
use Symfony\Component\ObjectMapper\Tests\Fixtures\LazyFoo;
use Symfony\Component\ObjectMapper\Tests\Fixtures\MapStruct\AToBMapper;
use Symfony\Component\ObjectMapper\Tests\Fixtures\MapStruct\MapStructMapperMetadataFactory;
use Symfony\Component\ObjectMapper\Tests\Fixtures\MapStruct\Source;
Expand Down Expand Up @@ -371,14 +370,6 @@ public static function objectMapperProvider(): iterable
yield [new ObjectMapper(new ReflectionObjectMapperMetadataFactory(), PropertyAccess::createPropertyAccessor())];
}

public function testMapInitializesLazyObject()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we need to rewrite the test instead to not use the LazyGhostTrait. The code that is tested by this method is still present: https://github.com/symfony/symfony/blob/8.0/src/Symfony/Component/ObjectMapper/ObjectMapper.php#L320-L321

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LazyObjectInterface is still used by interface-based proxies. That's likely what we need also on lower branches since it should allow writing code that'll work with all version. ProxyHelper::generateLazyProxy(null, [SomeInterace::class])

{
$lazy = new LazyFoo();
$mapper = new ObjectMapper();
$mapper->map($lazy, \stdClass::class);
$this->assertTrue($lazy->isLazyObjectInitialized());
}

public function testMapInitializesNativePhp84LazyObject()
{
$initialized = false;
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy