Want to validate variable in PHPUnit? I used numeric static method in mistake for Validator (it’s my stupid mistake :)) ), I should use make static method and pass the values and rules.
public function testMyCode()
$values = [
'num' => '0123456'
$test = Validator::make($values,[
'num' => 'numeric'
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.