File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed
Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -59,4 +59,9 @@ export WPT_SSH_PRIVATE_KEY_BASE64=
5959
6060# Output logging
6161# Use 'verbose' to increase verbosity
62- export WPT_DEBUG=
62+ export WPT_DEBUG=
63+
64+ # Certificate validation
65+ # Use 1 to validate, and 0 to not validate
66+ export WPT_CERTIFICATE_VALIDATION=1
67+
Original file line number Diff line number Diff line change 2828$ WPT_SSH_OPTIONS = trim ( getenv ( 'WPT_SSH_OPTIONS ' ) ) ? : '-o StrictHostKeyChecking=no ' ;
2929$ WPT_TEST_DIR = trim ( getenv ( 'WPT_TEST_DIR ' ) );
3030$ WPT_PHP_EXECUTABLE = trim ( getenv ( 'WPT_PHP_EXECUTABLE ' ) ) ? : 'php ' ;
31+ $ WPT_CERTIFICATE_VALIDATION = trim ( getenv ( 'WPT_CERTIFICATE_VALIDATION ' ) );
3132
3233/**
3334 * Determines if the debug mode is enabled based on the 'WPT_DEBUG' environment variable.
4142 break ;
4243 case 1 :
4344 case 'true ' :
44- $ WPT_DEBUG = true ;
45- break ;
4645 case 'verbose ' :
4746 $ WPT_DEBUG = 'verbose ' ;
4847 break ;
9897
9998}
10099
100+ /**
101+ * Don't validate the TLS certificate
102+ * Useful for local environments
103+ */
104+ $ certificate_validation = '' ;
105+ if ( ! $ WPT_CERTIFICATE_VALIDATION ) {
106+ $ certificate_validation .= ' --no-check-certificate ' ;
107+ }
108+
101109/**
102110 * Performs a series of operations to set up the test environment. This includes creating a preparation directory,
103111 * cloning the WordPress development repository, downloading the WordPress importer plugin, and preparing the environment with npm.
113121 'git clone --depth=1 https://github.com/WordPress/wordpress-develop.git ' . escapeshellarg ( $ WPT_PREPARE_DIR ),
114122
115123 // Download the WordPress importer plugin zip file to the specified plugins directory.
116- 'wget -O ' . escapeshellarg ( $ WPT_PREPARE_DIR . '/tests/phpunit/data/plugins/wordpress-importer.zip ' ) . ' https://downloads.wordpress.org/plugin/wordpress-importer.zip ' ,
124+ 'wget -O ' . escapeshellarg ( $ WPT_PREPARE_DIR . '/tests/phpunit/data/plugins/wordpress-importer.zip ' ) . ' https://downloads.wordpress.org/plugin/wordpress-importer.zip ' . $ certificate_validation ,
117125
118126 // Change directory to the plugin directory, unzip the WordPress importer plugin, and remove the zip file.
119127 'cd ' . escapeshellarg ( $ WPT_PREPARE_DIR . '/tests/phpunit/data/plugins/ ' ) . '; unzip wordpress-importer.zip; rm wordpress-importer.zip ' ,
Original file line number Diff line number Diff line change 4141 break ;
4242 case 1 :
4343 case 'true ' :
44- $ WPT_DEBUG = true ;
45- break ;
4644 case 'verbose ' :
4745 $ WPT_DEBUG = 'verbose ' ;
4846 break ;
You can’t perform that action at this time.
0 commit comments