Skip to content

Commit

Permalink
Merge pull request #306 from andrewnicols/outputComponentsOptionalReq…
Browse files Browse the repository at this point in the history
…uire

Stop autoloading lib/outputcomponents.php if the classes already exist
  • Loading branch information
junpataleta authored Jun 27, 2024
2 parents ee6273f + 76b8513 commit 378fb23
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit 378fb23

Please sign in to comment.