Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement/140 Bump WordPress and PHP minimums #143

Merged
merged 9 commits into from
Aug 22, 2022
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
matrix:
core:
- {name: 'WP latest', version: 'latest'}
- {name: 'WP minimum', version: 'WordPress/WordPress#4.9'}
- {name: 'WP minimum', version: 'WordPress/WordPress#5.7'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
php-version: '7.4'
tools: composer:v2
coverage: none

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/php-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
php_compatibility:
name: PHP minimum 5.6
name: PHP minimum 7.4
runs-on: ubuntu-latest

steps:
Expand All @@ -21,12 +21,12 @@ jobs:
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 7.2
php-version: 7.4
tools: composer:v2
coverage: none

- name: Install dependencies
run: composer update -W

- name: Check PHP Compatibility
run: vendor/bin/phpcs simple-local-avatars.php includes/ --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 5.6-
run: vendor/bin/phpcs simple-local-avatars.php includes/ --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 7.4-
20 changes: 1 addition & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,13 @@ on:
- develop

jobs:
# test_wpa:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Set PHP version
# uses: shivammathur/setup-php@v1
# with:
# php-version: '7.2'
# coverage: none
#
# - name: Install dependencies
# run: composer install

phpunit:
name: ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# We claim to support from 5.6+ but WP Mock only supports 7.1+
# Also an issue with WP Mock not working on PHPUnit 9.5+, which PHP 7.3+ needs.
# php: [ '5.6', '7.0', '7.4', '8.0', '8.1' ]
php: [ '7.1', '7.2' ]
php: [ '7.4', '8.0' ]

steps:
- name: Checkout
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"source": "https://github.com/10up/simple-local-avatars"
},
"require": {
"php": ">=5.6"
"php": ">=7.4"
},
"require-dev": {
"10up/phpcs-composer": "dev-master",
Expand All @@ -28,12 +28,12 @@
},
"scripts": {
"lint": [
"phpcs . --runtime-set testVersion 5.6-"
"phpcs . --runtime-set testVersion 7.4-"
],
"lint-fix": [
"phpcbf ."
],
"phpcs:compat": "vendor/bin/phpcs simple-local-avatars.php includes --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 5.6-"
"phpcs:compat": "vendor/bin/phpcs simple-local-avatars.php includes --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 7.4-"
},
"minimum-stability": "dev"
}
41 changes: 19 additions & 22 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
<phpunit
bootstrap="tests/phpunit/bootstrap.php"
backupGlobals="false"
processIsolation="false"
colors="false">
<testsuites>
<testsuite name="Simple Local Avatars">
<directory suffix="Test.php">./tests/phpunit</directory>
<exclude>tests/phpunit/multisite</exclude>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">includes</directory>
<exclude></exclude>
</whitelist>
</filter>
<php>
<ini name="error_reporting" value="32767" />
<ini name="display_errors" value="1" />
<ini name="display_startup_errors" value="1" />
</php>
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/phpunit/bootstrap.php" backupGlobals="false" processIsolation="false" colors="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">includes</directory>
</include>
<exclude/>
</coverage>
<testsuites>
<testsuite name="Simple Local Avatars">
<directory suffix="Test.php">./tests/phpunit</directory>
<exclude>tests/phpunit/multisite</exclude>
</testsuite>
</testsuites>
<php>
<ini name="error_reporting" value="32767"/>
<ini name="display_errors" value="1"/>
<ini name="display_startup_errors" value="1"/>
</php>
</phpunit>
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: jakemgold, 10up, thinkoomph, jeffpaul, faisal03
Donate link: https://10up.com/plugins/simple-local-avatars-wordpress/
Tags: avatar, gravatar, user photos, users, profile
Requires at least: 4.6
Requires at least: 5.7
Tested up to: 6.0
Requires PHP: 5.6
Requires PHP: 7.4
Stable tag: 2.5.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down
4 changes: 2 additions & 2 deletions simple-local-avatars.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Plugin URI: https://10up.com/plugins/simple-local-avatars-wordpress/
* Description: Adds an avatar upload field to user profiles. Generates requested sizes on demand, just like Gravatar! Simple and lightweight.
* Version: 2.5.0
* Requires at least: 4.6
* Requires PHP: 5.6
* Requires at least: 5.7
* Requires PHP: 7.4
* Author: Jake Goldman, 10up
* Author URI: https://10up.com
* License: GPLv2 or later
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/SimpleLocalAvatarsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class SimpleLocalAvatarsTest extends \WP_Mock\Tools\TestCase {
private $instance;

public function setUp(): void {
parent::setUp();
\WP_Mock::setUp();

$this->instance = Mockery::mock( 'Simple_Local_Avatars' )->makePartial();

Expand Down Expand Up @@ -75,7 +75,7 @@ public function tearDown(): void {
$this->addToAssertionCount(
Mockery::getContainer()->mockery_getExpectationCount()
);
parent::tearDown();
\WP_Mock::tearDown();
}

public function test_add_hooks() {
Expand Down