In my test I create a model so I can test my command, but if the test fails, I want to remove my model but it never reachs File::delete(app_path() . '/Test.php'); How can I make some method that reachs when the assert fails?
Normally you do things like this in setUp() and tearDown() methods within your test class. These methods are always called just before and just after your test method is executed.
Another approach would be to wrap your assertions in a try catch.... didn't test it but I think it should work.