joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.77k stars 3.65k forks source link

Travis uses no longer supported PHPUnit 4.8.35 #15986

Closed PhilETaylor closed 7 years ago

PhilETaylor commented 7 years ago

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

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

mbabker commented 7 years ago

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.

PhilETaylor commented 7 years ago

Gulp :)