Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop autoloading lib/outputcomponents.php if the classes already exist #306

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions verify_phpunit_xml/create_phpunit_xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,15 @@

// Now, let's invoke phpunit utils to generate the phpunit.xml file

// We need to load a few stuff.
// We need to load a few things manually.
require_once($options['basedir'] . '/lib/phpunit/classes/util.php');
require_once($options['basedir'] . '/lib/outputcomponents.php');

if (!class_exists(\core\output\core_renderer::class)) {
// From Moodle 4.5 we start to autoload the output components and including outputcomponents.php will throw an exception.
// If the core_renderer class can be autoloaded then we do not need to include outputcomponents.php.
require_once($options['basedir'] . '/lib/outputcomponents.php');
}

require_once($options['basedir'] . '/lib/testing/lib.php');
phpunit_util::build_config_file();

Expand Down
Loading