Skip to content

Conversation

@PhilETaylor
Copy link
Contributor

@PhilETaylor PhilETaylor commented Dec 29, 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

@PhilETaylor

This comment was marked as abuse.

@chmst chmst changed the base branch from 4.0-dev to 4.1-dev January 31, 2022 17:38
@laoneo
Copy link
Member

laoneo commented May 26, 2022

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

@laoneo
Copy link
Member

laoneo commented May 26, 2022

And #37595.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants