Commit 67087bbd authored by Artem Baranovskyi's avatar Artem Baranovskyi
Browse files

Auto phpunit testsuite config added.

parent c888fbcb
...@@ -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}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment