Skip to content
Snippets Groups Projects
Commit de745858 authored by Liam Morland's avatar Liam Morland
Browse files

ISTWCMS-2220: Add testing script

parent 74aed215
No related branches found
No related tags found
7 merge requests!433ISTWCMS-6296 Create test for all event dates test cases,!136Istwcms 4725 ebremner config sync,!63Feature/istwcms 4512 l26yan add first last name fields to users,!48Feature/istwcms 4465 l26yan remove paragraphs edit from base profile,!9Feature/istwcms 4139 l26yan update leaflet,!8Feature/istwcms 4156 l26yan set up catalogs terms,!2Feature/istwcms 4137 ebremner use linkit
<?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];
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment