Phalcon\Test\Unit\Forms\FormTest::testCreatingElementsWithNameSimilarToTheFormMethods PHP Method

testCreatingElementsWithNameSimilarToTheFormMethods() public method

Tests Form::render
Since: 2016-07-17
Author: Serghei Iakovlev ([email protected])
    public function testCreatingElementsWithNameSimilarToTheFormMethods()
    {
        $this->specify('Form::render does not return expected result', function ($name) {
            $form = new Form();
            $element = new Text($name);
            expect($element->getName())->equals($name);
            $form->add($element);
            expect($form->render($name))->equals(sprintf('<input type="text" id="%s" name="%s" />', $name, $name));
            expect($form->getValue($name))->null();
            expect($element->getValue())->null();
        }, ['examples' => $this->nameLikeFormMethodsProvider()]);
    }