Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[6.x] Add hasMacro methods to Eloquent Builder #30008
Adding 3 new public methods to the Eloquent Builder for convenience to allow tests to assert on whether or not the Builder class has global macros - or an instance of it, local macros - registered to it.
This will allow for tests where the assertion is looking to see if a macro method is registered without having to be concerned about the macro's specific implementation, as demonstrated.
It also allows for a more defensive style of coding against Builder macros, if you're that way inclined. For those times when you prefer to check that a macro is registered rather than handling the exception thrown when it isn't.