Skip to content

Commit e5ccf22

Browse files
authored
Merge pull request afragen#4 from costdev/test-install-git-updater
2 parents 3e0243d + 9ed832c commit e5ccf22

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

.github/workflows/wp-phpunit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
##- main
1414
pull_request:
1515
branches:
16-
##- develop
16+
- develop
1717
- master
1818
##- main
1919

bin/install-wp-tests.sh

+11
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,17 @@ install_db() {
115115
mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
116116
}
117117

118+
install_gu() {
119+
if [ -d "${WP_CORE_DIR}wp-content/plugins/git-updater" ]; then
120+
return;
121+
fi
122+
123+
local LATEST_GU_ZIP=$(curl -s https://api.github.com/repos/afragen/git-updater/releases/latest | grep browser_download_url | cut -d '"' -f 4)
124+
curl -L $LATEST_GU_ZIP > ${WP_CORE_DIR}wp-content/plugins/git-updater.zip
125+
unzip -q ${WP_CORE_DIR}wp-content/plugins/git-updater.zip -d ${WP_CORE_DIR}wp-content/plugins
126+
}
127+
118128
install_wp
119129
install_test_suite
120130
install_db
131+
install_gu

tests/bootstrap.php

+9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@
2020
// Give access to tests_add_filter() function.
2121
require_once $_tests_dir . '/includes/functions.php';
2222

23+
/**
24+
* Manually load dependencies.
25+
*/
26+
function _manually_load_dependencies() {
27+
echo 'Loading Git Updater...' . PHP_EOL;
28+
require WP_PLUGIN_DIR . '/git-updater/git-updater.php';
29+
}
30+
tests_add_filter( 'muplugins_loaded', '_manually_load_dependencies' );
31+
2332
/**
2433
* Manually load the plugin being tested.
2534
*/

0 commit comments

Comments
 (0)