PopTest\Form\FormTest::testFilter PHP Method

testFilter() public method

public testFilter ( )
    public function testFilter()
    {
        $fields = array('username' => array('type' => 'text', 'value' => 'Username here...', 'label' => 'Username:', 'required' => true, 'attributes' => array('size' => 40)));
        $f = new Form('/submit', 'post', $fields);
        $f->setFieldValues(array('username' => '<p>te\'st"<script>user</script></p>'), array('strip_tags' => '<p>', 'htmlentities' => array(ENT_QUOTES, 'UTF-8')));
        $this->assertEquals('&lt;p&gt;te&#039;st&quot;user&lt;/p&gt;', $f->username);
        $f->filter(array('html_entity_decode' => array(ENT_QUOTES, 'UTF-8')));
        $this->assertEquals('<p>te\'st"user</p>', $f->username);
    }