Phalcon\Test\Unit\Tag\TagSearchFieldTest::testSearchFieldWithSetDefaultElementNotPresent PHP Method

testSearchFieldWithSetDefaultElementNotPresent() public method

Tests searchField with setDefault and element not present
Since: 2014-09-05
Author: Nikolaos Dimopoulos ([email protected])
    public function testSearchFieldWithSetDefaultElementNotPresent()
    {
        $this->specify("searchField with setDefault and element not present returns invalid HTML Strict", function () {
            $options = ['x_name', 'name' => 'x_other', 'class' => 'x_class', 'size' => '10'];
            $expected = '<input type="search" id="x_name" ' . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"';
            $this->tester->testFieldParameter('searchField', $options, $expected, false, 'setDefault');
        });
        $this->specify("searchField with setDefault and element not present returns invalid HTML XHTML", function () {
            $options = ['x_name', 'name' => 'x_other', 'class' => 'x_class', 'size' => '10'];
            $expected = '<input type="search" id="x_name" ' . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"';
            $this->tester->testFieldParameter('searchField', $options, $expected, true, 'setDefault');
        });
    }