Trevor
Trevor

Reputation: 6689

Autotest equivalent for PHP?

I have been using autotest for unit testing in ruby. Is there an equivalent for PHP that will run my unit tests after my code has been updated? I am using PHPUnit and Eclipse.

Upvotes: 5

Views: 1944

Answers (4)

chiborg
chiborg

Reputation: 28064

I use the entr command for this kind of task. It receives a list of files and runs the given command when one of the file changes.

Example:

find src test -name "*.php" -type f | entr phpunit

The good thing about entr is that it's language- and command-agnostic, I can use it for phpunit, JavaScript unit test, linting, etc. Also, compared to watchr, I only have to install one command instead of a ruby runtime.

Upvotes: 0

Michael J. Calkins
Michael J. Calkins

Reputation: 32645

I use grunt and grunt-phpunit to watch my application and run the tests when I change the files.

http://michaelcalkins.com/post/71024731696/run-phpunit-tests-continuously-using-grunt

Upvotes: 0

slava
slava

Reputation: 524

hot phpunit runner

that is watcher for files and entities

can run tests for changed entities/domains and tests too

Upvotes: 3

user260199
user260199

Reputation: 86

You could use watchr to watch your directory and run phpunit whenever a file changes.

http://github.com/mynyml/watchr

Upvotes: 7

Related Questions