setChild example

$this->assertSame('bar', $inner->bar);
        $this->assertNull($inner->foo);
    }

    public function testDeepObjectToPopulate()
    {
        $child = new DeepObjectPopulateChildDummy();
        $child->bar = 'bar-old';
        $child->foo = 'foo-old';

        $parent = new DeepObjectPopulateParentDummy();
        $parent->setChild($child);

        $context = [
            'object_to_populate' => $parent,
            'deep_object_to_populate' => true,
        ];

        $normalizer = $this->getDenormalizerForObjectToPopulate();

        $newChild = new DeepObjectPopulateChildDummy();
        $newChild->bar = 'bar-new';
        $newChild->foo = 'foo-old';

        
Home | Imprint | This part of the site doesn't use cookies.