Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\Phalcon\Tag::selectStatic - does not set id correctly #54

Closed
niden opened this issue Sep 5, 2012 · 4 comments
Closed

\Phalcon\Tag::selectStatic - does not set id correctly #54

niden opened this issue Sep 5, 2012 · 4 comments
Labels
bug A bug report status: medium Medium

Comments

@niden
Copy link
Member

niden commented Sep 5, 2012

If the id is passed in the selectStatic as a parameter, we end up with two id tags in the output.

$params = array(
            'some_field_name',
            'id'    => 'some_id',
            'class' => 'some_class',
        );
        $options = array(
            'A' => 'Active',
            'I' => 'Inactive',
        );
        $expected = '<select id="some_id" name="some_field_name" '
                  . 'class="some_class">' . PHP_EOL
                  . chr(9) . '<option value="A">Active</option>' . PHP_EOL
                  . chr(9) . '<option value="I">Inactive</option>' . PHP_EOL
                  . '</select>';
        $actual   = Tg::selectStatic($params, $options);

        $this->assertEquals(
            $expected,
            $actual,
            sprintf(
                $this->message,
                'selectStatic with id in parameters'
            )
        );
@niden
Copy link
Member Author

niden commented Sep 5, 2012

Branch: Tests
Tests:
testSelectStaticWithIdInParameters_T54
testSelectStaticWithNameAndNotIdInParameters_T54

@phalcon
Copy link
Collaborator

phalcon commented Sep 5, 2012

This problem was fixed yesterday, can you check it please?

@niden
Copy link
Member Author

niden commented Sep 5, 2012

Confirmed. Tests pass.

@niden niden closed this as completed Sep 5, 2012
@niden niden reopened this Sep 8, 2012
@niden
Copy link
Member Author

niden commented Sep 8, 2012

Removed comment, I will open a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: medium Medium
Projects
None yet
Development

No branches or pull requests

1 participant