? ? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
29 Dec 2021

Summary of Changes

In developing the first ever Joomla 4 Extension test (#36482) it became apparent that when running Unit Tests, Auto loading of Joomla CMS classes was not working.

For the purposes of #36482 I simply included the classes, but this is unsustainable for the future and autoloader should work.

This PR cleans up the bootstrap process for Unit Tests, and implements a cut down namespace map for Unit Testing (as we cannot use the /administrator/cache/autoload_psr4.php as it doesnt exist at this point, and to create it requires the full working stack and DB, and unit testing is about testing the smallest part of code at a time... to much overhead to use that map, so we have a much smaller one for Unit testing anyway (one class to load at present!)

Testing Instructions

If the unit tests all still work - then this PR works.

Once merged the Unit test in #36482 can be tweaked to remove the setUp function.

Actual result BEFORE applying this Pull Request

Unit tests run fine - but autoloading of Joomla CMS namespaces classes fails

Expected result AFTER applying this Pull Request

Unit tests run fine - and autoloading of Joomla CMS namespaces classes works

Documentation Changes Required

None

avatar PhilETaylor PhilETaylor - open - 29 Dec 2021
avatar PhilETaylor PhilETaylor - change - 29 Dec 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 29 Dec 2021
Category Unit Tests
avatar PhilETaylor PhilETaylor - change - 29 Dec 2021
Labels Added: ? ?
avatar PhilETaylor PhilETaylor - change - 29 Dec 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 29 Dec 2021
avatar PhilETaylor
PhilETaylor - comment - 30 Dec 2021

@wilsonge Im switching this PR to draft until I check it again after the autoloading issue you reported - thanks.

avatar PhilETaylor PhilETaylor - change - 6 Mar 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-03-06 21:07:02
Closed_By PhilETaylor
Labels Added: ?
Removed: ?
avatar PhilETaylor PhilETaylor - close - 6 Mar 2022
avatar laoneo
laoneo - comment - 26 May 2022

Just for reference, this one works since ##37592.

avatar laoneo
laoneo - comment - 26 May 2022

And #37595.

Add a Comment

Login with GitHub to post a comment