[13.x] Improved artisan mocking

Merged
JN
1mo ago
+77-12

The current artisan helper method for test cases has two minor limitations:

  • when one wishes to switch between 'mock' and non-'mock' mode, that requires continuous toggling
  • the return type of this method is marked as PendingCommand|int, requiring additional type assertions or checks in environments with strict static type checking

To overcome these limitations, this PR introduces two dedicated methods for the two distinct ways to run artisan commands within tests.

Open to naming suggestions for these methods.