diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index a29f8f90..c8908b86 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -76,6 +76,10 @@ jobs: # Bust the cache at least once a month - output format: YYYY-MM-DD. custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F") + # Some images won't have svn available. Install it if that's the case. + - name: Install SVN + run: sudo apt-get update && sudo apt-get install -y subversion + - name: Install WP shell: bash run: tests/bin/install-wp-tests.sh wordpress_tests root '' 127.0.0.1:3306 ${{ matrix.wp_version }} diff --git a/admin/class-scans-stats.php b/admin/class-scans-stats.php index 84d1d9da..5dd2491a 100644 --- a/admin/class-scans-stats.php +++ b/admin/class-scans-stats.php @@ -109,9 +109,10 @@ public function clear_cache() { /** * Gets summary information about all scans * - * @return array . + * @param boolean $skip_cache whether to skip the cache. + * @return array */ - public function summary() { + public function summary( $skip_cache = false ) { global $wpdb; @@ -119,7 +120,7 @@ public function summary() { $cache = get_transient( $transient_name ); - if ( $this->cache_time && $cache ) { + if ( ! $skip_cache && ( $this->cache_time && $cache ) ) { if ( $cache['expires_at'] >= time() && $cache['cached_at'] + $this->cache_time >= time() ) { diff --git a/tests/phpunit/helper-functions/OrdinalTest.php b/tests/phpunit/helper-functions/OrdinalTest.php index 7e44482a..6b5a36e7 100644 --- a/tests/phpunit/helper-functions/OrdinalTest.php +++ b/tests/phpunit/helper-functions/OrdinalTest.php @@ -132,7 +132,7 @@ public function edac_ordinal_data() { // Tests for the `ar` locale. 'integer 1, ar' => [ 'numeric_value' => 1, - 'ordinal_value' => '١.', + 'ordinal_value' => '١', 'locale' => 'ar', 'ordinal_value_no_php-intl' => '1st', ], @@ -140,7 +140,7 @@ public function edac_ordinal_data() { // Tests for the `el_GR` locale. 'integer 1, el_GR' => [ 'numeric_value' => 1, - 'ordinal_value' => '1.', + 'ordinal_value' => '1', 'locale' => 'el_GR', 'ordinal_value_no_php-intl' => '1st', ],