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

testSelectStaticArrayParameter() public method

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