Test Driven Development in PHP

前端 未结 8 1841
青春惊慌失措
青春惊慌失措 2021-01-29 23:47

I am a web-developer working in PHP. I have some limited experience with using Test Driven Development in C# desktop applications. In that case we used nUnit for the unit testin

相关标签:
8条回答
  • 2021-01-30 00:25

    I personally prefer SimpleTest. There is a command line test runner and web-based test runner, and there is even an Eclipse plugin to let you run unit tests from the IDE itself. I found the Zend to PHPUnit connection much harder to get working, especially with the debugger.

    The way we use SimpleTest in-house is with a continuous integration script that we wrote ourselves. Every time we check in a feature to SVN we include the unit tests. Every hour or so, the CI script runs and calls a command line PHP script that runs all of our unit tests. If any break, I get an email. It's been a great way to reduce bugs in our systems.

    However, you can just as easily use something like Phing to run your tests automatically, either on a cron job or with an SVN check-in hook.

    In fact, if you want to contact me directly for further help, you can get to me through my profile info on SO. I'd love to help you out.

    0 讨论(0)
  • 2021-01-30 00:25

    SimpleTest is a great system. I started out with it about 5 months ago, having never heard of TDD, and SimpleTest is easy to learn but still powerful. As for resources, I'm currently reading TDD By Example by Kent Beck, and it's good.

    0 讨论(0)
提交回复
热议问题