diff --git a/public/admin/tool/behat/cli/run.php b/public/admin/tool/behat/cli/run.php index e0e33016f35..eaa5bb953f4 100644 --- a/public/admin/tool/behat/cli/run.php +++ b/public/admin/tool/behat/cli/run.php @@ -273,7 +273,7 @@ if (empty($parallelrun)) { } // Execute all commands, relative to moodle root directory. - $processes = cli_execute_parallel($cmds, __DIR__ . "/../../../../", BEHAT_PARALLEL_START_DELAY); + $processes = cli_execute_parallel($cmds, __DIR__ . "/../../../../../", BEHAT_PARALLEL_START_DELAY); $stoponfail = empty($options['stop-on-failure']) ? false : true; // Print header. @@ -525,4 +525,3 @@ function get_status_lines_from_run_op(Symfony\Component\Process\Process $process return $statusstr; } - diff --git a/public/admin/tool/componentlibrary/config.yml b/public/admin/tool/componentlibrary/config.yml index 1ef66f95de8..4dbb86fbfe0 100644 --- a/public/admin/tool/componentlibrary/config.yml +++ b/public/admin/tool/componentlibrary/config.yml @@ -51,13 +51,13 @@ blackfriday: relativeURLs: true -publishDir: "./admin/tool/componentlibrary/docs" -archetypeDir: "./admin/tool/componentlibrary/hugo/archetypes" -assetDir: "./admin/tool/componentlibrary/hugo/assets" -contentDir: "./admin/tool/componentlibrary/content" -dataDir: "./admin/tool/componentlibrary/hugo/site/data" -layoutDir: "./admin/tool/componentlibrary/hugo/site/layouts" -staticDir: "./admin/tool/componentlibrary/content/static" +publishDir: "./public/admin/tool/componentlibrary/docs" +archetypeDir: "./public/admin/tool/componentlibrary/hugo/archetypes" +assetDir: "./public/admin/tool/componentlibrary/hugo/assets" +contentDir: "./public/admin/tool/componentlibrary/content" +dataDir: "./public/admin/tool/componentlibrary/hugo/site/data" +layoutDir: "./public/admin/tool/componentlibrary/hugo/site/layouts" +staticDir: "./public/admin/tool/componentlibrary/content/static" params: moodleroot: "MOODLEROOT" diff --git a/public/admin/tool/componentlibrary/content/moodle/components/coursecards.md b/public/admin/tool/componentlibrary/content/moodle/components/coursecards.md index ca449302845..c99f5b88fc0 100644 --- a/public/admin/tool/componentlibrary/content/moodle/components/coursecards.md +++ b/public/admin/tool/componentlibrary/content/moodle/components/coursecards.md @@ -118,15 +118,15 @@ Cards usually don't really look great without images. That's why we show a place {{< example show_markup="false">}}
{{< root.inline >}} -{{- $pl1 := readFile "admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-1.txt" -}} -{{- $pl2 := readFile "admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-2.txt" -}} -{{- $pl3 := readFile "admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-3.txt" -}} -{{- $pl4 := readFile "admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-4.txt" -}} -{{- $pl5 := readFile "admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-5.txt" -}} -{{- $pl6 := readFile "admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-6.txt" -}} -{{- $pl7 := readFile "admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-7.txt" -}} -{{- $pl8 := readFile "admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-8.txt" -}} -{{- $pl9 := readFile "admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-9.txt" -}} +{{- $pl1 := readFile "public/admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-1.txt" -}} +{{- $pl2 := readFile "public/admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-2.txt" -}} +{{- $pl3 := readFile "public/admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-3.txt" -}} +{{- $pl4 := readFile "public/admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-4.txt" -}} +{{- $pl5 := readFile "public/admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-5.txt" -}} +{{- $pl6 := readFile "public/admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-6.txt" -}} +{{- $pl7 := readFile "public/admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-7.txt" -}} +{{- $pl8 := readFile "public/admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-8.txt" -}} +{{- $pl9 := readFile "public/admin/tool/componentlibrary/content/static/moodle/components/coursecards/placeholder-9.txt" -}}
diff --git a/public/admin/tool/phpunit/cli/util.php b/public/admin/tool/phpunit/cli/util.php index 6c14e852429..ff5eb956ddd 100644 --- a/public/admin/tool/phpunit/cli/util.php +++ b/public/admin/tool/phpunit/cli/util.php @@ -118,7 +118,7 @@ Options: -h, --help Print out this help Example: -\$ php ".testing_cli_argument_path('/admin/tool/phpunit/cli/util.php')." --install +\$ php ".testing_cli_argument_path('/public/admin/tool/phpunit/cli/util.php')." --install "; echo $help; exit(0); diff --git a/public/course/tests/course_delete_modules_test.php b/public/course/tests/course_delete_modules_test.php index 290879bd750..7e9f5d0033e 100644 --- a/public/course/tests/course_delete_modules_test.php +++ b/public/course/tests/course_delete_modules_test.php @@ -111,7 +111,7 @@ final class course_delete_modules_test extends \advanced_testcase { $this->assertStringContainsString('course/lib.php', $errormsg); $this->assertStringContainsString('mod/TestModuleToDelete/lib.php is missing', $errormsg); // Get line numbers array which contains the exception name. - $lines = array_keys(preg_grep("/cannotdeletemodulemissinglib/", file('course/lib.php'))); + $lines = array_keys(preg_grep("/cannotdeletemodulemissinglib/", file(dirname(__DIR__) . '/lib.php'))); // Increase 1 to keys to convert to actual line number. $lines = array_map(function($key) { return ++$key; diff --git a/public/lib/behat/classes/behat_command.php b/public/lib/behat/classes/behat_command.php index 8e07e2f8a70..8a5701cbd9d 100644 --- a/public/lib/behat/classes/behat_command.php +++ b/public/lib/behat/classes/behat_command.php @@ -135,6 +135,7 @@ class behat_command { $command = 'php ' . $pathprefix . 'admin' . $separator . 'tool' . $separator . 'behat' . $separator . 'cli' . $separator . 'run.php'; } + return $command; } diff --git a/public/lib/behat/lib.php b/public/lib/behat/lib.php index 2a2c37bf9f6..ac79d4f8ec2 100644 --- a/public/lib/behat/lib.php +++ b/public/lib/behat/lib.php @@ -66,11 +66,11 @@ function behat_error($errorcode, $text = '') { $text = 'Behat permissions problem: ' . $text . ', check the permissions'; break; case BEHAT_EXITCODE_REINSTALL: - $path = testing_cli_argument_path('/admin/tool/behat/cli/init.php'); + $path = testing_cli_argument_path('/public/admin/tool/behat/cli/init.php'); $text = "Reinstall Behat: ".$text.", use:\n php ".$path; break; case BEHAT_EXITCODE_INSTALL: - $path = testing_cli_argument_path('/admin/tool/behat/cli/init.php'); + $path = testing_cli_argument_path('/public/admin/tool/behat/cli/init.php'); $text = "Install Behat before enabling it, use:\n php ".$path; break; case BEHAT_EXITCODE_INSTALLED: @@ -214,7 +214,7 @@ function behat_clean_init_config() { global $CFG; $allowed = array_flip(array( - 'wwwroot', 'dataroot', 'dirroot', 'admin', 'directorypermissions', 'filepermissions', + 'wwwroot', 'dataroot', 'root', 'dirroot', 'admin', 'directorypermissions', 'filepermissions', 'umaskpermissions', 'dbtype', 'dblibrary', 'dbhost', 'dbname', 'dbuser', 'dbpass', 'prefix', 'dboptions', 'proxyhost', 'proxyport', 'proxytype', 'proxyuser', 'proxypassword', 'proxybypass', 'pathtogs', 'pathtophp', 'pathtodu', 'aspellpath', 'pathtodot', 'skiplangupgrade', @@ -530,7 +530,7 @@ function behat_get_run_process() { * @return array list of processes. */ function cli_execute_parallel($cmds, $cwd = null, $delay = 0) { - require_once(__DIR__ . "/../../vendor/autoload.php"); + require_once(__DIR__ . "/../../../vendor/autoload.php"); $processes = array(); diff --git a/public/lib/external/tests/external_api_test.php b/public/lib/external/tests/external_api_test.php index b22419fb76d..d5be8ce9ff0 100644 --- a/public/lib/external/tests/external_api_test.php +++ b/public/lib/external/tests/external_api_test.php @@ -483,7 +483,7 @@ final class external_api_test extends \advanced_testcase { // which is necessary to test things like class autoloading. $this->add_full_mocked_plugintype( plugintype: 'fake', - path: 'lib/tests/fixtures/fakeplugins/fake', + path: 'public/lib/tests/fixtures/fakeplugins/fake', ); $this->deprecate_full_mocked_plugintype('fake'); external_update_descriptions('fake_fullfeatured'); @@ -515,7 +515,7 @@ final class external_api_test extends \advanced_testcase { // which is necessary to test things like class autoloading. $this->add_full_mocked_plugintype( plugintype: 'fake', - path: 'lib/tests/fixtures/fakeplugins/fake', + path: 'public/lib/tests/fixtures/fakeplugins/fake', ); $this->delete_full_mocked_plugintype('fake'); external_update_descriptions('fake_fullfeatured'); diff --git a/public/lib/phpunit/bootstraplib.php b/public/lib/phpunit/bootstraplib.php index a9640994bfd..48c75dfa1dc 100644 --- a/public/lib/phpunit/bootstraplib.php +++ b/public/lib/phpunit/bootstraplib.php @@ -65,11 +65,11 @@ function phpunit_bootstrap_error($errorcode, $text = '') { $text = "Moodle PHPUnit environment configuration warning:\n".$text; break; case PHPUNIT_EXITCODE_INSTALL: - $path = testing_cli_argument_path('/admin/tool/phpunit/cli/init.php'); + $path = testing_cli_argument_path('/public/admin/tool/phpunit/cli/init.php'); $text = "Moodle PHPUnit environment is not initialised, please use:\n php $path"; break; case PHPUNIT_EXITCODE_REINSTALL: - $path = testing_cli_argument_path('/admin/tool/phpunit/cli/init.php'); + $path = testing_cli_argument_path('/public/admin/tool/phpunit/cli/init.php'); $text = "Moodle PHPUnit environment was initialised for different version, please use:\n php $path"; break; default: diff --git a/public/lib/setuplib.php b/public/lib/setuplib.php index cb155574c3c..9ebddda6b9d 100644 --- a/public/lib/setuplib.php +++ b/public/lib/setuplib.php @@ -79,7 +79,7 @@ function get_whoops(): ?\Whoops\Run { return null; } - $composerautoload = "{$CFG->dirroot}/vendor/autoload.php"; + $composerautoload = "{$CFG->dirroot}/../vendor/autoload.php"; if (file_exists($composerautoload)) { require_once($composerautoload); } diff --git a/public/lib/testing/lib.php b/public/lib/testing/lib.php index f8a69fd2cfe..568674c22fe 100644 --- a/public/lib/testing/lib.php +++ b/public/lib/testing/lib.php @@ -58,7 +58,7 @@ function testing_cli_argument_path($moodlepath) { $cwd = substr($cwd, -1); } - $path = realpath($CFG->dirroot.$moodlepath); + $path = realpath(dirname($CFG->dirroot).$moodlepath); // We need standrad directory seperator for path and cwd, so it can be compared. $cwd = testing_cli_fix_directory_separator($cwd); diff --git a/public/lib/tests/event/manager_test.php b/public/lib/tests/event/manager_test.php index e79bd7ea8b1..0470b151c90 100644 --- a/public/lib/tests/event/manager_test.php +++ b/public/lib/tests/event/manager_test.php @@ -44,7 +44,7 @@ final class manager_test extends \advanced_testcase { // This 'fake_fullfeatured' plugin is an available plugin at this stage (not yet deprecated). $this->add_full_mocked_plugintype( plugintype: 'fake', - path: 'lib/tests/fixtures/fakeplugins/fake', + path: 'public/lib/tests/fixtures/fakeplugins/fake', ); $observers = array_filter( diff --git a/public/lib/tests/hook/manager_test.php b/public/lib/tests/hook/manager_test.php index 84c64dd00ce..4e54e4c1cc9 100644 --- a/public/lib/tests/hook/manager_test.php +++ b/public/lib/tests/hook/manager_test.php @@ -498,7 +498,7 @@ final class manager_test extends \advanced_testcase { // This 'fake_fullfeatured' plugin is an available plugin at this stage (not yet deprecated). $this->add_full_mocked_plugintype( plugintype: 'fake', - path: 'lib/tests/fixtures/fakeplugins/fake', + path: 'public/lib/tests/fixtures/fakeplugins/fake', ); // Force reset the static instance cache \core\hook\manager::$instance so that a fresh instance is instantiated, ensuring diff --git a/public/lib/tests/moodlelib_test.php b/public/lib/tests/moodlelib_test.php index df666632012..080164dce6a 100644 --- a/public/lib/tests/moodlelib_test.php +++ b/public/lib/tests/moodlelib_test.php @@ -5740,7 +5740,7 @@ EOT; // which is necessary to test things like class autoloading, required for class callbacks checks. $this->add_full_mocked_plugintype( plugintype: 'fake', - path: 'lib/tests/fixtures/fakeplugins/fake', + path: 'public/lib/tests/fixtures/fakeplugins/fake', ); $this->deprecate_full_mocked_plugintype('fake'); @@ -5783,7 +5783,7 @@ EOT; // which is necessary to test things like class autoloading, required for class callbacks checks. $this->add_full_mocked_plugintype( plugintype: 'fake', - path: 'lib/tests/fixtures/fakeplugins/fake', + path: 'public/lib/tests/fixtures/fakeplugins/fake', ); $this->delete_full_mocked_plugintype('fake'); diff --git a/public/lib/tests/plugin_manager_test.php b/public/lib/tests/plugin_manager_test.php index 09d775bf0e4..55557e3a8a2 100644 --- a/public/lib/tests/plugin_manager_test.php +++ b/public/lib/tests/plugin_manager_test.php @@ -804,7 +804,7 @@ final class plugin_manager_test extends \advanced_testcase { // Inject the mock plugin 'fake_fullfeatured' and deprecate it. $this->add_full_mocked_plugintype( plugintype: 'fake', - path: 'lib/tests/fixtures/fakeplugins/fake', + path: 'public/lib/tests/fixtures/fakeplugins/fake', ); $this->deprecate_full_mocked_plugintype('fake'); @@ -867,7 +867,7 @@ final class plugin_manager_test extends \advanced_testcase { // 3. fulldeletedsubtype_demo: a deleted subplugin type. $this->add_full_mocked_plugintype( plugintype: 'fake', - path: 'lib/tests/fixtures/fakeplugins/fake', + path: 'public/lib/tests/fixtures/fakeplugins/fake', subpluginsupport: true ); @@ -934,7 +934,7 @@ final class plugin_manager_test extends \advanced_testcase { // Inject the mock plugin 'fake_fullfeatured', and deprecate it. $this->add_full_mocked_plugintype( plugintype: 'fake', - path: 'lib/tests/fixtures/fakeplugins/fake', + path: 'public/lib/tests/fixtures/fakeplugins/fake', ); $this->delete_full_mocked_plugintype('fake'); @@ -999,7 +999,7 @@ final class plugin_manager_test extends \advanced_testcase { // 3. fulldeletedsubtype_demo: a deleted subplugin type. $this->add_full_mocked_plugintype( plugintype: 'fake', - path: 'lib/tests/fixtures/fakeplugins/fake', + path: 'public/lib/tests/fixtures/fakeplugins/fake', subpluginsupport: true ); diff --git a/public/mod/data/tests/entries_export_test.php b/public/mod/data/tests/entries_export_test.php index bb7e323625a..470e65834cd 100644 --- a/public/mod/data/tests/entries_export_test.php +++ b/public/mod/data/tests/entries_export_test.php @@ -151,9 +151,9 @@ final class entries_export_test extends \advanced_testcase { // file stored in a file and picture field. // So we expect that this file has to have the same content as sample.png. // Also, the default value for the subdirectory in the zip archive containing the files is 'files/'. - 'files/samplefile.png' => 'mod/data/field/picture/pix/sample.png', - 'files/samplefile_1.png' => 'mod/data/field/picture/pix/sample.png', - 'files/picturefile.png' => 'mod/data/field/picture/pix/sample.png', + 'files/samplefile.png' => 'public/mod/data/field/picture/pix/sample.png', + 'files/samplefile_1.png' => 'public/mod/data/field/picture/pix/sample.png', + 'files/picturefile.png' => 'public/mod/data/field/picture/pix/sample.png', // By checking that the content of the exported csv is identical to the fixture file it is verified // that the filenames in the csv file correspond to the names of the exported file. // It also verifies that files with identical file names in different fields (or records) will be numbered