diff --git a/run-tests.php b/run-tests.php new file mode 100644 index 0000000000000000000000000000000000000000..33da3c294bc36eab4d74834abe44bbd34ca7a2a7 --- /dev/null +++ b/run-tests.php @@ -0,0 +1,41 @@ +<?php + +/** + * @file + * Wrapper to run WCMS tests with Drupal's run-tests.sh. + */ + +$site_to_test = $_SERVER['argv'][1] ?? NULL; +if (!$site_to_test || in_array($site_to_test, ['-h', '--help', '-v', '--version'])) { + $script = basename($_SERVER['argv'][0]); + echo 'Usage: ' . $script . " URL-TO-TEST [ADDITIONAL-ARGUMENTS ...]\n"; + echo "In Drupal 8, pass the argument --suppress-deprecations.\n"; + exit; +} + +// Keep copy of original arguments to add to those set by this script. +$original_argv = $_SERVER['argv']; +// Remove script name and site URL. +array_shift($original_argv); +array_shift($original_argv); + +$modules_to_test = [ + 'uw_base_profile', +]; + +// Arguments to set when running run-tests.sh. +$_SERVER['argv'] = [ + 'run-tests.sh', + '--verbose', + '--color', + '--sqlite', + '/tmp/drupal/test.sqlite', + '--module', + implode(',', $modules_to_test), + '--url', + $site_to_test, +]; +$_SERVER['argv'] = array_merge($_SERVER['argv'], $original_argv); + +// Run the tests. +require __DIR__ . '/../../core/scripts/' . $_SERVER['argv'][0];