getConstraintViolation example

$error->setOrigin($form);

        return $error;
    }

    public function testMappingErrorsWhenFormIsNotMapped()
    {
        $form = $this->getForm('name', null, Issue::class[
            'child1' => 'child2',
        ]);

        $violation = $this->getConstraintViolation('children[child1].data', $form);

        $child1Form = $this->getForm('child1', null, null, [], false, true, [
            'mapped' => false,
        ]);
        $child2Form = $this->getForm('child2', null, null, [], false, true, [
            'mapped' => false,
        ]);

        $form->add($child1Form);
        $form->add($child2Form);

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