Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pado
Asyst Moodle Plugin
Commits
67087bbd
Commit
67087bbd
authored
Sep 20, 2024
by
Artem Baranovskyi
Browse files
Auto phpunit testsuite config added.
parent
c888fbcb
Changes
1
Show whitespace changes
Inline
Side-by-side
install_moodle.sh
View file @
67087bbd
...
@@ -66,6 +66,23 @@ docker-compose exec moodle bash -c "
...
@@ -66,6 +66,23 @@ docker-compose exec moodle bash -c "
# Next, configure PHPUnit for Moodle:
# Next, configure PHPUnit for Moodle:
docker-compose
exec
moodle php admin/tool/phpunit/cli/init.php
docker-compose
exec
moodle php admin/tool/phpunit/cli/init.php
# Define the path to the phpunit.xml file
PHPUNIT_XML_PATH
=
"/var/www/html/moodle/phpunit.xml"
# Define the content to insert for your plugin's test suite
TEST_SUITE_ENTRY
=
'<testsuite name="Unit Tests">
<directory>local/asystgrade/tests</directory>
</testsuite>'
# Check if the plugin suite is already defined in phpunit.xml
if
grep
-q
"local/asystgrade/tests"
"
$PHPUNIT_XML_PATH
"
;
then
echo
"Test suite for asystgrade plugin already exists in phpunit.xml."
else
# Use sed to insert the test suite entry right before @plugin_suites_end@
sed
-i
"/@plugin_suites_end@/i
$TEST_SUITE_ENTRY
"
"
$PHPUNIT_XML_PATH
"
echo
"Test suite for asystgrade plugin added to phpunit.xml."
fi
# Ensure correct ownership and permissions after installation
# Ensure correct ownership and permissions after installation
docker-compose
exec
moodle
chown
-R
www-data:www-data
${
MOODLE_BASE_DIR
}
docker-compose
exec
moodle
chown
-R
www-data:www-data
${
MOODLE_BASE_DIR
}
docker-compose
exec
moodle
chmod
-R
755
${
MOODLE_BASE_DIR
}
docker-compose
exec
moodle
chmod
-R
755
${
MOODLE_BASE_DIR
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment