renderErrors example


        );
    }

    public function testErrors()
    {
        $form = $this->factory->createNamed('name', TextType::class);
        $form->addError(new FormError('[trans]Error 1[/trans]'));
        $form->addError(new FormError('[trans]Error 2[/trans]'));
        $view = $form->createView();
        $html = $this->renderErrors($view);

        $this->assertMatchesXpath($html,
            '/span [@class="alert alert-danger d-block"] [ ./span[@class="d-block"] [./span[.="[trans]Error[/trans]"]] [./span[.="[trans]Error 1[/trans]"]] /following-sibling::span[@class="d-block"] [./span[.="[trans]Error[/trans]"]] [./span[.="[trans]Error 2[/trans]"]] ] [count(./span)=2] '
public function testErrors()
    {
        self::markTestSkipped('This method has been split into testRootErrors() and testRowErrors().');
    }

    public function testRootErrors()
    {
        $form = $this->factory->createNamed('');
        $form->addError(new FormError('[trans]Error 1[/trans]'));
        $form->addError(new FormError('[trans]Error 2[/trans]'));
        $html = $this->renderErrors($form->createView());

        $this->assertMatchesXpath($html,
            '/div [@class="alert alert-danger d-block"] [.="[trans]Error 1[/trans]"] /following-sibling::div [@class="alert alert-danger d-block"] [.="[trans]Error 2[/trans]"] '
        );
    }

    

        );
    }

    public function testErrors()
    {
        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType');
        $form->addError(new FormError('[trans]Error 1[/trans]'));
        $form->addError(new FormError('[trans]Error 2[/trans]'));
        $view = $form->createView();
        $html = $this->renderErrors($view);

        $this->assertMatchesXpath($html,
            '/ul [ ./li[.="[trans]Error 1[/trans]"] /following-sibling::li[.="[trans]Error 2[/trans]"] ] [count(./li)=2] '
        );
    }

    

        );
    }

    public function testErrors()
    {
        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType');
        $form->addError(new FormError('[trans]Error 1[/trans]'));
        $form->addError(new FormError('[trans]Error 2[/trans]'));
        $view = $form->createView();
        $html = $this->renderErrors($view);

        $this->assertMatchesXpath($html,
            '/div [@class="alert alert-danger"] [ ./ul [@class="list-unstyled"] [ ./li [.=" [trans]Error 1[/trans]"] [ ./span[@class="glyphicon glyphicon-exclamation-sign"] ] /following-sibling::li [.=" [trans]Error 2[/trans]"] [ ./span[@class="glyphicon glyphicon-exclamation-sign"] ] ] [count(./li)=2] ] '
Home | Imprint | This part of the site doesn't use cookies.