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::resetInput does not seem to work #53

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

\Phalcon\Tag::resetInput does not seem to work #53

niden opened this issue Sep 4, 2012 · 2 comments
Milestone

Comments

@niden
Copy link
Member

niden commented Sep 4, 2012

I am running the following unit test

    public function testResetInput()
    {
        $this->_loadDI();

        $options  = 'some_field_name';
        $expected = '<input type="text" name="some_field_name" '
                  . 'id="some_field_name" value="Wall-E"/>';
        Tg::setDefault('some_field_name', 'Wall-E');
        $actual   = Tg::textField($options);

        $this->assertEquals(
            $expected,
            $actual,
            sprintf($this->message, 'resetInput before contains a value')
        );
        Tg::resetInput();

        $expected = '<input type="text" name="some_field_name" '
                  . 'id="some_field_name" value=""/>';
        $this->assertEquals(
            $expected,
            $actual,
            sprintf($this->message, 'resetInput after contains a value')
        );
    }

The test fails at the second assertion. The result is:

Failed asserting that two strings are equal.

Expected :<input type="text" name="some_field_name" id="some_field_name" value=""/>
Actual   :<input type="text" name="some_field_name" id="some_field_name" value="Wall-E"/>
@niden
Copy link
Member Author

niden commented Sep 5, 2012

Branch: tests
Test: testResetInput_T53

@phalcon
Copy link
Collaborator

phalcon commented Sep 12, 2012

Hi Nikolaos, actually this isn't a bug, in your test after made the: Tg::resetInput();

you need to call again: $actual = Tg::textField($options);

that's why it appears to fail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant