Summer Sale! All accounts are 50% off this week.

laracoft's avatar

Automated testing workflow

I'm looking to run Laravel tests automatically, anything out there that is easy to setup and maintain?

Currently, I run a single test case to write code, after it passes, I may run the whole test class, but rarely do I run every single test in the project, I only do that after the bulk of what I want to write is done and that's where surprises may pop up.

Of course, it is already much better compared to not writing tests at all. The issue with the above is I don't always have the discipline to run project tests, that's why I'm making this post.

I mean, I'm quite new to this that I don't even know when is the best time to run all the tests. As we are working? After code is commited?

Thank you.

0 likes
2 replies
MohamedTammam's avatar

I believe that's the right approach, running all tests every time to test only one test will waste a lot of time.

For me I run only one test method at a time and then the whole test class for some feature and after finishing the feature I run all tests before committing to make sure I didn't commit any errors.

laracoft's avatar

@mohamedtammam

Thanks. There are actually 2 parts to this, 1st is how to do TDD, 2nd is how to setup an automated workflow.

I think we both agree on the 1st, but the issue I faced were the surprises as several projects rely on the code that I change. It would be much better to get the surprises within minutes instead of hours/days later.

Anyway, I'm looking into phpunit-watcher.

Please or to participate in this conversation.