eZ Community » Forums » eZ Publish 5 Platform » Why is there no unit testing within...
expandshrink

Why is there no unit testing within the eZDemo bundle?

Why is there no unit testing within the eZDemo bundle?

Wednesday 27 November 2013 2:34:40 pm - 1 reply

Hello,

Our development team keeps getting referred to examine the code in the eZDemo bundle for best practices.  However, why are there no unit tests within this bundle?  It would be extremely helpful to see this added.  I would even contribute to adding the tests myself to the repo if I understood how to get started with unit testing within the new Symfony stack.  Does anyone have any pointers or examples that I can use?

Thanks,
Seiji 

Monday 02 December 2013 9:37:50 am

Hi Seiji

Actually we didn't add unit tests because we're focusing on BDD with Behat (see https://github.com/ezsystems/DemoBundle/pulls).

However some components definitely worth to be unit tested! If you want to contribute, all you need to know to get kickstarted is the following:

  • Always test from within the bundle
  • Inside the bundle directory, do a composer install, to get all dependencies (of course you'll need PHPUnit to be installed)
  • Create a phpunit.xml (you can get inspired from the one in EzPublishCoreExtraBundle)
  • You'll have to create a bootstrap script (which is mentioned in phpunit.xml).
  • Create your test cases inside the Tests/ directory (that you'll need to create as well) and respect PSR-0 for autoloading

And you're ready to go!

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from