diff --git a/.gitignore b/.gitignore index a12294daaa..2318c5c292 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ TODO /vendor-prefixed-backup tests/_output/* tests/_support/_generated/* +tests/plugins node_modules .env npm-debug.log diff --git a/RoboFile.php b/RoboFile.php index cd5e412c05..38f938d9b8 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -903,12 +903,12 @@ class RoboFile extends \Robo\Tasks { exit(0); // Exit with 0 since it is a valid state for some environments } $this->createGithubClient('woocommerce/woocommerce-subscriptions') - ->downloadReleaseZip('woocommerce-subscriptions.zip', __DIR__ . '/tools/vendor/', $tag); + ->downloadReleaseZip('woocommerce-subscriptions.zip', __DIR__ . '/tests/plugins/', $tag); } public function downloadWooCommerceZip($tag = null) { $this->createGithubClient('woocommerce/woocommerce') - ->downloadReleaseZip('woocommerce.zip', __DIR__ . '/tools/vendor/', $tag); + ->downloadReleaseZip('woocommerce.zip', __DIR__ . '/tests/plugins/', $tag); } public function generateData($generatorName = null) { diff --git a/tasks/GithubClient.php b/tasks/GithubClient.php index 4b67c89809..b12e09dd55 100644 --- a/tasks/GithubClient.php +++ b/tasks/GithubClient.php @@ -37,6 +37,9 @@ class GithubClient { if (!$assetDownloadUrl) { throw new \Exception("Release zip for $tag not found"); } + if (!is_dir($downloadDir)) { + mkdir($downloadDir, 0777, true); + } $this->httpClient->get($assetDownloadUrl, ['sink' => $downloadDir . $zip, 'headers' => ['Accept' => 'application/octet-stream']]); } diff --git a/tests/docker/codeception/docker-entrypoint.sh b/tests/docker/codeception/docker-entrypoint.sh index 0fd5fd466f..582b31f83b 100755 --- a/tests/docker/codeception/docker-entrypoint.sh +++ b/tests/docker/codeception/docker-entrypoint.sh @@ -54,7 +54,7 @@ fi # Install WooCommerce if [[ ! -d "/wp-core/wp-content/plugins/woocommerce" ]]; then cd /wp-core/wp-content/plugins - WOOCOMMERCE_CORE_ZIP="/wp-core/wp-content/plugins/mailpoet/tools/vendor/woocommerce.zip" + WOOCOMMERCE_CORE_ZIP="/wp-core/wp-content/plugins/mailpoet/tests/plugins/woocommerce.zip" if [ ! -f "$WOOCOMMERCE_CORE_ZIP" ]; then echo "WooCommerce plugin zip not found. Downloading WooCommerce plugin latest zip" cd /project @@ -68,7 +68,7 @@ fi # Install WooCommerce Subscriptions if [[ ! -d "/wp-core/wp-content/plugins/woocommerce-subscriptions" ]]; then - WOOCOMMERCE_SUBS_ZIP="/wp-core/wp-content/plugins/mailpoet/tools/vendor/woocommerce-subscriptions.zip" + WOOCOMMERCE_SUBS_ZIP="/wp-core/wp-content/plugins/mailpoet/tests/plugins/woocommerce-subscriptions.zip" if [ ! -f "$WOOCOMMERCE_SUBS_ZIP" ]; then echo "WooCommerce Subscriptions plugin zip not found. Downloading WooCommerce Subscription plugin latest zip" cd /project