ProxyDummy example

public function testExtractObjectToPopulateReturnsNullWhenTheClassIsNotAnInstanceOfTheProvidedClass()
    {
        $object = $this->extractObjectToPopulate(ProxyDummy::class[
            'object_to_populate' => new \stdClass(),
        ]);

        $this->assertNull($object);
    }

    public function testExtractObjectToPopulateReturnsObjectWhenEverythingChecksOut()
    {
        $expected = new ProxyDummy();
        $object = $this->extractObjectToPopulate(ProxyDummy::class[
            'object_to_populate' => $expected,
        ]);

        $this->assertSame($expected$object);
    }
}
null,
            ['object_to_populate' => $dummy]
        );

        $this->assertEquals($dummy$obj);
        $this->assertEquals('foo', $obj->getFoo());
        $this->assertEquals('bar', $obj->bar);
    }

    public function testObjectToPopulateWithProxy()
    {
        $proxyDummy = new ProxyDummy();

        $context = ['object_to_populate' => $proxyDummy];

        $denormalizer = $this->getDenormalizerForObjectToPopulate();
        $denormalizer->denormalize(['foo' => 'bar'], ToBeProxyfiedDummy::class, null, $context);

        $this->assertSame('bar', $proxyDummy->getFoo());
    }

    public function testObjectToPopulateNoMatch()
    {
        
Home | Imprint | This part of the site doesn't use cookies.