pyrometer
pyrometer

Reputation: 881

Laravel and Simpletest

I am trying to use Simpletest for unit-testing with Laravel.

I know Laravel comes integrated with PHPUnit support and I know that PHPUnit is the industry standard, but having worked with simpletest in my last project, (CakePHP 1.3) I was hoping I could use in with Laravel too.

As of now, there is no mention of Simpletest in Laravel documentation. Links to blogs/tutorials will be appreciated.

Upvotes: 4

Views: 690

Answers (2)

Alexandre Butynski
Alexandre Butynski

Reputation: 6746

If you want a solution to execute easily and automatically your test suite, I recommand you to use a combination of phpunit and watchr.

Watchr is a small and flexible ruby gem, watching all the files you specify and executing scripts when you save them. You just have to install the gem and add a config file like mine in your project : https://gist.github.com/alexandre-butynski/5460980.

Then just type watchr watchr.rb in a console to execute automatically the tests when you save a file. My config file specify the tests to execute according to the file saved. For example, if you update UserController.php, only UserControllerTest.php will be executed.

My config file add a growl integration to show messages after each test execution. You need small images to make it work. Don't hesitate to ask me more explanations about this tool.

Upvotes: 0

Dirk
Dirk

Reputation: 357

I dont' understand the problem you have. You can choose which unit test tool you will use, because you should only test your own written code, never the code of someone else.

You can create a folder like "simpletests" and inside you can put your bootstrap and your tests and run it.

But, when you're not a simpletest specialist you really should use PHPUnit. Not because it's nearly standard, but when you have unit test support inside the framework for PHPUnit, you should use it.

Upvotes: 2

Related Questions