Move all files to decoupling-drupal-vuejs/demo/

This commit is contained in:
Oliver Davies 2025-10-02 12:23:37 +01:00
parent a5f598deff
commit 92cba01aa5
296 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,37 @@
#!/usr/bin/env bash
#: exec_target = cli
## Creates a phpunit.xml file and runs PHPUnit tests in Drupal 8
##
## Usage: fin phpunit <args>
##
## This first ensures that a `core/phpunit.xml` file exists, either by copying a
## stub from `.docksal/drupal/core/phpunit.xml` if that exists, or copying and
## renaming `core/phpunit.xml.dist`.
##
## If `core/phpunit.xml` exists, the phpunit command with then be run, appending
## any optional arguments such as the directory path (run `fin phpunit -h`) to
## see a full list of options.
DOCROOT_PATH="${PROJECT_ROOT}/${DOCROOT}"
DRUPAL_CORE_PATH="${DOCROOT_PATH}/core"
run_tests() {
${PROJECT_ROOT}/vendor/bin/phpunit -c ${DRUPAL_CORE_PATH} "$@"
}
if [ ! -e ${DRUPAL_CORE_PATH}/phpunit.xml ]; then
if [ -e "${PROJECT_ROOT}/.docksal/drupal/core/phpunit.xml" ]; then
echo "Copying ${PROJECT_ROOT}/.docksal/drupal/core/phpunit.xml to ${DRUPAL_CORE_PATH}/phpunit.xml"
cp "${PROJECT_ROOT}/.docksal/drupal/core/phpunit.xml" ${DRUPAL_CORE_PATH}/phpunit.xml
run_tests "$@"
else
echo "Copying phpunit.xml.dist to phpunit.xml."
echo "Please edit it's values as needed and re-run 'fin phpunit'."
cp ${DRUPAL_CORE_PATH}/phpunit.xml.dist ${DRUPAL_CORE_PATH}/phpunit.xml
exit 1;
fi
else
run_tests "$@"
fi