?
avatar PhilETaylor
PhilETaylor
12 May 2017

So, Travis is currently using PHPUnit 4.8.35 to run our suite of tests.

  • PHPUnit 6.1 is the current stable release series. It became stable on April 7, 2017. Support for PHPUnit 6 ends on February 8, 2019.

  • PHPUnit 5.7 is the old stable release series. It became stable on December 2, 2016. Support for PHPUnit 5 ends on February 2, 2018.

  • PHPUnit 4.8 is no longer supported. It became stable on August 7, 2015. Support for PHPUnit 4 ended on February 3, 2017.

  • PHPUnit 6 requires PHP 7.0 or PHP 7.1

On an up to date Mac, installing PHPUnit with brew, you get PHPUnit 6.1.3

When you go on to run the unit test suite that comes with Joomla you get

PHP Warning: Uncaught Error: Class 'PHPUnit_Util_ErrorHandler' not found in /Users/phil/Sites/joomla-cms/tests/unit/core/helper.php:52

Therefore the unit test suites are not compatible with current stable release of phpunit...

We cannot run an up to date phpunit version in travis because we need PHP 7 for that.

even removing PHPUnit_Util_ErrorHandler from helper.php leads to the next error

Fatal error: JLoader::main(): Failed opening required 'PHPUnit/Extensions/Database/TestCase.php'

So the future of unit testing in Joomla is what exactly?

@mbabker

avatar PhilETaylor PhilETaylor - open - 12 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 12 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 May 2017
avatar mbabker
mbabker - comment - 12 May 2017
  1. Run composer install to get our dev dependencies installed then run PHPUnit via libraries/vendor/bin/phpunit versus using your global install.

  2. You need phpunit/dbunit installed.

  3. We're still using 4.8 because that is the only version to support anything earlier than PHP 5.6 and our test suite uses functionality removed from PHPUnit 5. Until the deprecated functionality is replaced, there's no point trying to make our CI builds conditionally use newer PHPUnit versions.

avatar PhilETaylor PhilETaylor - change - 12 May 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-05-12 12:40:05
Closed_By PhilETaylor
avatar PhilETaylor PhilETaylor - close - 12 May 2017
avatar PhilETaylor
PhilETaylor - comment - 12 May 2017

Gulp :)

Add a Comment

Login with GitHub to post a comment