I'm using Phalcon 3.0.3 and PHP 7.0.15-0ubuntu0.16.04.4
with PHPUnit 6.0.8. If I try to use Phalcon\Validation\Validator\Callback
I'll always end up with those kind of errros:
1) Test\ConfirmActivityTest::testConfirm
Error: Class 'Phalcon\Validation\Validator\Callback' not found
So far the only way I found to solve this problem is to create a copy of that class in my codebase:
namespace Phapp\Validators;
/**
* A workaround to fix the namespace problem of
* Phalcon\Validation\Validator\Callback
*
*/
class CallbackValidator extends \Phalcon\Validation\Validator
{
/**
* Executes the validation
*
* @param \Phalcon\Validation $validation
* @param string $field
* @return bool
*/
public function validate(\Phalcon\Validation $validation, $field) {}
}
Is there any other workaround I could use to solve this problem? Is it a Phalcon bug?