check for method not to exist globally

16 views Asked by At

I want to do pest architecture test to check whether (AnyModel)::all() is not present in my project globally. Here (AnyModel) is going to be any model. How can I achieve it .

Here is my code

<?php
$regex = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*::all\(\)/';
arch('Check for (AnyModel)::all() usage')
    ->expect(['global'])
    ->not->toHaveMethod('$regex')
    ->in('global');

but this code isnt working.

As i am new to testing i am not able to solve it by own, I will be glad if anyone help me out

I want to do pest architecture test to check whether (AnyModel)::all() is not present in my project globally. Here (AnyModel) is going to be any model. How can I achieve it .

0

There are 0 answers