Phalcon\Test\Unit\Tag\TagResetInputTest::testResetInputWithDisplayTo PHP Method

testResetInputWithDisplayTo() public method

Tests resetInput with displayTo
Since: 2014-09-05
Author: Nikolaos Dimopoulos ([email protected])
    public function testResetInputWithDisplayTo()
    {
        $this->specify("resetInput with displayTo returns invalid HTML Strict", function () {
            Tag::setDocType(Tag::XHTML10_STRICT);
            $options = 'x_name';
            $expected = '<input type="text" id="x_name" name="x_name" ' . 'value="x_other" />';
            Tag::displayTo('x_name', 'x_other');
            $actual = Tag::textField($options);
            Tag::resetInput();
            expect($actual)->equals($expected);
            $expected = '<input type="text" id="x_name" name="x_name" />';
            $actual = Tag::textField($options);
            expect($actual)->equals($expected);
        });
        $this->specify("resetInput with displayTo returns invalid HTML XHTML", function () {
            Tag::setDocType(Tag::HTML5);
            $options = 'x_name';
            $expected = '<input type="text" id="x_name" name="x_name" ' . 'value="x_other">';
            Tag::displayTo('x_name', 'x_other');
            $actual = Tag::textField($options);
            Tag::resetInput();
            expect($actual)->equals($expected);
            $expected = '<input type="text" id="x_name" name="x_name">';
            $actual = Tag::textField($options);
            expect($actual)->equals($expected);
        });
    }