Skip to content

Commit

Permalink
chore: merge v3 branch in feature branch
Browse files Browse the repository at this point in the history
  • Loading branch information
florianbrinkmann committed May 22, 2024
2 parents 199ed6d + 260756e commit a864d94
Show file tree
Hide file tree
Showing 82 changed files with 2,413 additions and 573 deletions.
20 changes: 0 additions & 20 deletions .eslintrc

This file was deleted.

137 changes: 65 additions & 72 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Tests, Behat, Coding Standards
on: push
jobs:
test:
test-unit:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.3', '7.2', '5.4']
php-versions: ['8.3', '7.4']
steps:
- uses: actions/checkout@master
- name: Setup PHP
Expand All @@ -14,87 +14,80 @@ jobs:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl
ini-values: post_max_size=256M, short_open_tag=On
tools: phpunit, composer
- name: Set COMPOSER environment variable for 5.4
if: matrix.php-versions == '5.4'
run: echo "COMPOSER=composer-php-5-4.json" >> $GITHUB_ENV
- name: Run tests
tools: composer
- name: Install
run: |
composer install
./vendor/bin/phpunit -c ./phpunit.xml.dist
behat:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: pluginkollektiv_antispambee_behat
ports:
- '8888:3306'
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: ['8']
wordpress: ['nightly', 'latest']
include:
- php: '7.4'
wordpress: '5.5'
- php: '7.4'
wordpress: '5.4'
- php: '7.3'
wordpress: '5.3'
- php: '7.3'
wordpress: '5.2'
- php: '7.3'
wordpress: '5.1'
- php: '7.2'
wordpress: '4.9'
- php: '7.2'
wordpress: '4.8'
- php: '7.2'
wordpress: '4.7'
- php: '7.2'
wordpress: '4.6'
steps:
- uses: actions/checkout@master
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl, pdo_mysql, zip
ini-values: post_max_size=256M, short_open_tag=On
tools: phpunit, composer
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Install XVFB
run: sudo apt-get update && sudo apt-get install xvfb
- name: Run tests
run: |
composer install --ignore-platform-req=php
./bin/behat.sh
env:
WORDPRESS_VERSION: ${{ matrix.wordpress }}
NAP_LENGTH: 10
- name: Cleanup xvfb
uses: bcomnes/cleanup-xvfb@v1
composer test:unit
# behat:
# runs-on: ubuntu-latest
# services:
# mysql:
# image: mysql:5.7
# env:
# MYSQL_ALLOW_EMPTY_PASSWORD: yes
# MYSQL_DATABASE: pluginkollektiv_antispambee_behat
# ports:
# - '8888:3306'
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
# strategy:
# matrix:
# php: ['8']
# wordpress: ['nightly', 'latest']
# include:
# - php: '7.4'
# wordpress: '5.5'
# - php: '7.4'
# wordpress: '5.4'
# - php: '7.3'
# wordpress: '5.3'
# - php: '7.3'
# wordpress: '5.2'
# - php: '7.3'
# wordpress: '5.1'
# - php: '7.2'
# wordpress: '4.9'
# - php: '7.2'
# wordpress: '4.8'
# - php: '7.2'
# wordpress: '4.7'
# - php: '7.2'
# wordpress: '4.6'
# steps:
# - uses: actions/checkout@master
# - name: Setup PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php }}
# extensions: mbstring, intl, pdo_mysql, zip
# ini-values: post_max_size=256M, short_open_tag=On
# tools: phpunit, composer
# - name: Start mysql service
# run: sudo /etc/init.d/mysql start
# - name: Install XVFB
# run: sudo apt-get update && sudo apt-get install xvfb
# - name: Run tests
# run: |
# composer install --ignore-platform-req=php
# ./bin/behat.sh
# env:
# WORDPRESS_VERSION: ${{ matrix.wordpress }}
# NAP_LENGTH: 10
# - name: Cleanup xvfb
# uses: bcomnes/cleanup-xvfb@v1
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
extensions: mbstring, intl
ini-values: post_max_size=256M, short_open_tag=On
tools: phpunit, composer
- uses: actions/setup-node@v2
with:
node-version: '14'
php-version: '8.2'
tools: composer
- name: Run code style checks for CSS, JavaScript and PHP
run: |
composer install
npm install
composer lint-all
composer install --ignore-platform-req=php
./vendor/bin/phpcs --config-set ignore_warnings_on_exit 1
composer cs
5 changes: 0 additions & 5 deletions .stylelintrc.json

This file was deleted.

43 changes: 0 additions & 43 deletions composer-php-5-4.json

This file was deleted.

20 changes: 9 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,15 @@
"php": ">=7.0"
},
"require-dev": {
"behat/mink": "1.7.1",
"behat/mink-goutte-driver": "^1.2",
"brain/monkey": "^1.5",
"composer/package-versions-deprecated": "^1.11",
"dmore/behat-chrome-extension": "^1.3",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"friends-of-behat/mink-extension": "^2.5",
"paulgibbs/behat-wordpress-extension": "^3.3",
"behat/mink": "^v1.11.0",
"behat/mink-browserkit-driver": "^v2.2.0",
"dmore/behat-chrome-extension": "^1.4.0",
"dealerdirect/phpcodesniffer-composer-installer": "^v1.0.0",
"friends-of-behat/mink-extension": "^v2.7.5",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpunit/phpunit": "^4",
"wp-cli/wp-cli-bundle": "@stable",
"wp-coding-standards/wpcs": "^2.3"
"wp-coding-standards/wpcs": "^3.0.1",
"yoast/wp-test-utils": "^1.2.0"
},
"autoload": {
"psr-4": {
Expand All @@ -61,7 +58,8 @@
],
"lint-php": [
"phpcs --standard=phpcs.xml -s"
]
],
"test:unit": [ "phpunit -c phpunit.xml.dist --testsuite unit" ]
},
"config": {
"allow-plugins": {
Expand Down
31 changes: 1 addition & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,5 @@
"version": "3.0.0",
"description": "Antispam Bee blocks spam comments and trackbacks effectively and without captchas.",
"author": "pluginkollektiv",
"license": "GPL-2.0-or-later",
"main": "build/index.js",
"scripts": {
"build": "wp-scripts build",
"check-engines": "wp-scripts check-engines",
"check-licenses": "wp-scripts check-licenses",
"format:js": "wp-scripts format-js",
"format:js:src": "wp-scripts format-js ./src",
"lint:css": "wp-scripts lint-style",
"lint:css:src": "wp-scripts lint-style 'src/**/*.css'",
"lint:js": "wp-scripts lint-js",
"lint:js:src": "wp-scripts lint-js ./src",
"lint:md:docs": "wp-scripts lint-md-docs",
"lint:md:js": "wp-scripts lint-md-js",
"lint:pkg-json": "wp-scripts lint-pkg-json",
"packages-update": "wp-scripts packages-update",
"postpackages-update": "npm run build",
"start": "wp-scripts start",
"test:e2e": "wp-scripts test-e2e",
"test:unit": "wp-scripts test-unit-js"
},
"devDependencies": {
"@wordpress/scripts": "^18.1.0",
"classnames": "^2.3.1",
"svg-spritemap-webpack-plugin": "^4.3.3",
"url-loader": "^4.1.1"
},
"dependencies": {
"raphael": "^2.3.0"
}
"license": "GPL-2.0-or-later"
}
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

<rule ref="WordPress">
<!-- As we use PHP 5.4+ now, we can use the short array syntax -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
<!-- Uncomment if you develop a theme with templates for CPTs having a prefix -->
<exclude name="WordPress.Files.FileName" />
<!-- Uncomment for projects using the metabox toolbox -->
Expand Down
47 changes: 23 additions & 24 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="unit">
<directory suffix=".php">tests/Unit</directory>
</testsuite>
<testsuite name="integration">
<directory suffix=".php">tests/Integration</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="TestListener" file="tests/TestListener.php"/>
</listeners>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.2/phpunit.xsd"
backupGlobals="false"
bootstrap="./vendor/autoload.php"
colors="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
convertNoticesToExceptions="true"
convertDeprecationsToExceptions="true">
<testsuites>
<testsuite name="unit">
<directory suffix=".php">tests/Unit</directory>
<exclude>tests/Unit/AntispamBeeTest.php</exclude>
</testsuite>
<testsuite name="integration">
<directory suffix=".php">tests/Integration</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="TestListener" file="tests/TestListener.php"/>
</listeners>
</phpunit>
Loading

0 comments on commit a864d94

Please sign in to comment.