Phalcon\Test\Unit\Tag\TagSelectStaticTest::testSelectStaticWithDisplayTo PHP Method

testSelectStaticWithDisplayTo() public method

Tests selectStatic with displayTo
Since: 2014-09-05
Author: Nikolaos Dimopoulos ([email protected])
    public function testSelectStaticWithDisplayTo()
    {
        $this->specify("selectStatic with setDefault returns invalid HTML", function () {
            Tag::resetInput();
            $params = ['x_name', 'class' => 'x_class', 'size' => '10'];
            $options = ['A' => 'Active', 'I' => 'Inactive'];
            $expected = '<select id="x_name" name="x_name" class="x_class" size="10">' . PHP_EOL . chr(9) . '<option value="A">Active</option>' . PHP_EOL . chr(9) . '<option selected="selected" value="I">Inactive</option>' . PHP_EOL . '</select>';
            Tag::displayTo('x_name', 'I');
            $actual = Tag::selectStatic($params, $options);
            Tag::resetInput();
            expect($actual)->equals($expected);
        });
    }