PHPUnit tests in Eclipse - MakeGood, Luna and Composer -

2014-11-24

PHPUnit tests in Eclipse - MakeGood, Luna and Composer -

MakeGood is a continuous test runner to run unit tests on Eclipse PDT.

Environment

  • Mac 10.9 Maverics
  • PHP : 5.6 (Liip binary), Xdebug enabled
  • Eclipse for PHP Developers, Luna Service Release 1 (4.4.1)
  • MakeGood
  • PHPUnit 4 via project’s composer (local install)

Configure Eclipse (Project - [properties])

MakeGood

  • [General]

[Add] your [Test Folders]. Set the [Preload Script] to your bootstrap file.

Example:

[Test Folders] your-project_path/src, [Preload Script] bootstrap_test.php

  • [PHPUnit]

Set the path to the phpunit xml file under the PHPUnit tab.

PHP - [Build Path]

Your project path.

And you’re DONE!

Everything should be ready now. If you can’t see the MakeGood tab already, browse to Window > Show View > MakeGood.

… and see the results …

Happy TDD-ing♪