Closed
Description
Describe the bug
When using a closure as a filter sanitizing fails.
To Reproduce
Steps to reproduce the behavior:
$locator = new FilterFactory();
$filter = $locator->newInstance();
$filter->set(
'testappend',
function ($input) {
return $input.'test';
}
);
$value = 'cheese';
$actual = $filter->sanitize($value, 'testappend');
$expected = $value.'test';
$I->assertEquals($expected, $actual);
Output
[ArgumentCountError] Too few arguments to function Phalcon\Test\Unit\Filter\Filter\SanitizeMultipleCest::Phalcon\Test\Unit\Filter\Filter\{closure}(), 0 passed and exactly 1 expected
Details
- Phalcon version: (
4.0.0-rc.1
) - PHP Version: (
7.3
)