Skip to content

Commit a864d94

Browse files
chore: merge v3 branch in feature branch
2 parents 199ed6d + 260756e commit a864d94

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2413
-573
lines changed

.eslintrc

-20
This file was deleted.

.github/workflows/tests.yml

+65-72
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: Tests, Behat, Coding Standards
22
on: push
33
jobs:
4-
test:
4+
test-unit:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
php-versions: ['7.3', '7.2', '5.4']
8+
php-versions: ['8.3', '7.4']
99
steps:
1010
- uses: actions/checkout@master
1111
- name: Setup PHP
@@ -14,87 +14,80 @@ jobs:
1414
php-version: ${{ matrix.php-versions }}
1515
extensions: mbstring, intl
1616
ini-values: post_max_size=256M, short_open_tag=On
17-
tools: phpunit, composer
18-
- name: Set COMPOSER environment variable for 5.4
19-
if: matrix.php-versions == '5.4'
20-
run: echo "COMPOSER=composer-php-5-4.json" >> $GITHUB_ENV
21-
- name: Run tests
17+
tools: composer
18+
- name: Install
2219
run: |
2320
composer install
24-
./vendor/bin/phpunit -c ./phpunit.xml.dist
25-
behat:
26-
runs-on: ubuntu-latest
27-
services:
28-
mysql:
29-
image: mysql:5.7
30-
env:
31-
MYSQL_ALLOW_EMPTY_PASSWORD: yes
32-
MYSQL_DATABASE: pluginkollektiv_antispambee_behat
33-
ports:
34-
- '8888:3306'
35-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
36-
strategy:
37-
matrix:
38-
php: ['8']
39-
wordpress: ['nightly', 'latest']
40-
include:
41-
- php: '7.4'
42-
wordpress: '5.5'
43-
- php: '7.4'
44-
wordpress: '5.4'
45-
- php: '7.3'
46-
wordpress: '5.3'
47-
- php: '7.3'
48-
wordpress: '5.2'
49-
- php: '7.3'
50-
wordpress: '5.1'
51-
- php: '7.2'
52-
wordpress: '4.9'
53-
- php: '7.2'
54-
wordpress: '4.8'
55-
- php: '7.2'
56-
wordpress: '4.7'
57-
- php: '7.2'
58-
wordpress: '4.6'
59-
steps:
60-
- uses: actions/checkout@master
61-
- name: Setup PHP
62-
uses: shivammathur/setup-php@v2
63-
with:
64-
php-version: ${{ matrix.php }}
65-
extensions: mbstring, intl, pdo_mysql, zip
66-
ini-values: post_max_size=256M, short_open_tag=On
67-
tools: phpunit, composer
68-
- name: Start mysql service
69-
run: sudo /etc/init.d/mysql start
70-
- name: Install XVFB
71-
run: sudo apt-get update && sudo apt-get install xvfb
7221
- name: Run tests
7322
run: |
74-
composer install --ignore-platform-req=php
75-
./bin/behat.sh
76-
env:
77-
WORDPRESS_VERSION: ${{ matrix.wordpress }}
78-
NAP_LENGTH: 10
79-
- name: Cleanup xvfb
80-
uses: bcomnes/cleanup-xvfb@v1
23+
composer test:unit
24+
# behat:
25+
# runs-on: ubuntu-latest
26+
# services:
27+
# mysql:
28+
# image: mysql:5.7
29+
# env:
30+
# MYSQL_ALLOW_EMPTY_PASSWORD: yes
31+
# MYSQL_DATABASE: pluginkollektiv_antispambee_behat
32+
# ports:
33+
# - '8888:3306'
34+
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
35+
# strategy:
36+
# matrix:
37+
# php: ['8']
38+
# wordpress: ['nightly', 'latest']
39+
# include:
40+
# - php: '7.4'
41+
# wordpress: '5.5'
42+
# - php: '7.4'
43+
# wordpress: '5.4'
44+
# - php: '7.3'
45+
# wordpress: '5.3'
46+
# - php: '7.3'
47+
# wordpress: '5.2'
48+
# - php: '7.3'
49+
# wordpress: '5.1'
50+
# - php: '7.2'
51+
# wordpress: '4.9'
52+
# - php: '7.2'
53+
# wordpress: '4.8'
54+
# - php: '7.2'
55+
# wordpress: '4.7'
56+
# - php: '7.2'
57+
# wordpress: '4.6'
58+
# steps:
59+
# - uses: actions/checkout@master
60+
# - name: Setup PHP
61+
# uses: shivammathur/setup-php@v2
62+
# with:
63+
# php-version: ${{ matrix.php }}
64+
# extensions: mbstring, intl, pdo_mysql, zip
65+
# ini-values: post_max_size=256M, short_open_tag=On
66+
# tools: phpunit, composer
67+
# - name: Start mysql service
68+
# run: sudo /etc/init.d/mysql start
69+
# - name: Install XVFB
70+
# run: sudo apt-get update && sudo apt-get install xvfb
71+
# - name: Run tests
72+
# run: |
73+
# composer install --ignore-platform-req=php
74+
# ./bin/behat.sh
75+
# env:
76+
# WORDPRESS_VERSION: ${{ matrix.wordpress }}
77+
# NAP_LENGTH: 10
78+
# - name: Cleanup xvfb
79+
# uses: bcomnes/cleanup-xvfb@v1
8180
quality:
8281
runs-on: ubuntu-latest
8382
steps:
8483
- uses: actions/checkout@master
8584
- name: Setup PHP
8685
uses: shivammathur/setup-php@v2
8786
with:
88-
php-version: '7.2'
89-
extensions: mbstring, intl
90-
ini-values: post_max_size=256M, short_open_tag=On
91-
tools: phpunit, composer
92-
- uses: actions/setup-node@v2
93-
with:
94-
node-version: '14'
87+
php-version: '8.2'
88+
tools: composer
9589
- name: Run code style checks for CSS, JavaScript and PHP
9690
run: |
97-
composer install
98-
npm install
99-
composer lint-all
91+
composer install --ignore-platform-req=php
92+
./vendor/bin/phpcs --config-set ignore_warnings_on_exit 1
10093
composer cs

.stylelintrc.json

-5
This file was deleted.

composer-php-5-4.json

-43
This file was deleted.

composer.json

+9-11
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,15 @@
2525
"php": ">=7.0"
2626
},
2727
"require-dev": {
28-
"behat/mink": "1.7.1",
29-
"behat/mink-goutte-driver": "^1.2",
30-
"brain/monkey": "^1.5",
31-
"composer/package-versions-deprecated": "^1.11",
32-
"dmore/behat-chrome-extension": "^1.3",
33-
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
34-
"friends-of-behat/mink-extension": "^2.5",
35-
"paulgibbs/behat-wordpress-extension": "^3.3",
28+
"behat/mink": "^v1.11.0",
29+
"behat/mink-browserkit-driver": "^v2.2.0",
30+
"dmore/behat-chrome-extension": "^1.4.0",
31+
"dealerdirect/phpcodesniffer-composer-installer": "^v1.0.0",
32+
"friends-of-behat/mink-extension": "^v2.7.5",
3633
"phpcompatibility/phpcompatibility-wp": "^2.1",
37-
"phpunit/phpunit": "^4",
3834
"wp-cli/wp-cli-bundle": "@stable",
39-
"wp-coding-standards/wpcs": "^2.3"
35+
"wp-coding-standards/wpcs": "^3.0.1",
36+
"yoast/wp-test-utils": "^1.2.0"
4037
},
4138
"autoload": {
4239
"psr-4": {
@@ -61,7 +58,8 @@
6158
],
6259
"lint-php": [
6360
"phpcs --standard=phpcs.xml -s"
64-
]
61+
],
62+
"test:unit": [ "phpunit -c phpunit.xml.dist --testsuite unit" ]
6563
},
6664
"config": {
6765
"allow-plugins": {

package.json

+1-30
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,5 @@
33
"version": "3.0.0",
44
"description": "Antispam Bee blocks spam comments and trackbacks effectively and without captchas.",
55
"author": "pluginkollektiv",
6-
"license": "GPL-2.0-or-later",
7-
"main": "build/index.js",
8-
"scripts": {
9-
"build": "wp-scripts build",
10-
"check-engines": "wp-scripts check-engines",
11-
"check-licenses": "wp-scripts check-licenses",
12-
"format:js": "wp-scripts format-js",
13-
"format:js:src": "wp-scripts format-js ./src",
14-
"lint:css": "wp-scripts lint-style",
15-
"lint:css:src": "wp-scripts lint-style 'src/**/*.css'",
16-
"lint:js": "wp-scripts lint-js",
17-
"lint:js:src": "wp-scripts lint-js ./src",
18-
"lint:md:docs": "wp-scripts lint-md-docs",
19-
"lint:md:js": "wp-scripts lint-md-js",
20-
"lint:pkg-json": "wp-scripts lint-pkg-json",
21-
"packages-update": "wp-scripts packages-update",
22-
"postpackages-update": "npm run build",
23-
"start": "wp-scripts start",
24-
"test:e2e": "wp-scripts test-e2e",
25-
"test:unit": "wp-scripts test-unit-js"
26-
},
27-
"devDependencies": {
28-
"@wordpress/scripts": "^18.1.0",
29-
"classnames": "^2.3.1",
30-
"svg-spritemap-webpack-plugin": "^4.3.3",
31-
"url-loader": "^4.1.1"
32-
},
33-
"dependencies": {
34-
"raphael": "^2.3.0"
35-
}
6+
"license": "GPL-2.0-or-later"
367
}

phpcs.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
<rule ref="WordPress">
5454
<!-- As we use PHP 5.4+ now, we can use the short array syntax -->
55-
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
55+
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
5656
<!-- Uncomment if you develop a theme with templates for CPTs having a prefix -->
5757
<exclude name="WordPress.Files.FileName" />
5858
<!-- Uncomment for projects using the metabox toolbox -->

phpunit.xml.dist

+23-24
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
5-
backupGlobals="false"
6-
backupStaticAttributes="false"
7-
bootstrap="vendor/autoload.php"
8-
colors="true"
9-
convertErrorsToExceptions="true"
10-
convertNoticesToExceptions="true"
11-
convertWarningsToExceptions="true"
12-
processIsolation="false"
13-
stopOnFailure="false">
14-
<testsuites>
15-
<testsuite name="unit">
16-
<directory suffix=".php">tests/Unit</directory>
17-
</testsuite>
18-
<testsuite name="integration">
19-
<directory suffix=".php">tests/Integration</directory>
20-
</testsuite>
21-
</testsuites>
22-
<listeners>
23-
<listener class="TestListener" file="tests/TestListener.php"/>
24-
</listeners>
1+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.2/phpunit.xsd"
3+
backupGlobals="false"
4+
bootstrap="./vendor/autoload.php"
5+
colors="true"
6+
beStrictAboutTestsThatDoNotTestAnything="true"
7+
beStrictAboutOutputDuringTests="true"
8+
convertErrorsToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
convertNoticesToExceptions="true"
11+
convertDeprecationsToExceptions="true">
12+
<testsuites>
13+
<testsuite name="unit">
14+
<directory suffix=".php">tests/Unit</directory>
15+
<exclude>tests/Unit/AntispamBeeTest.php</exclude>
16+
</testsuite>
17+
<testsuite name="integration">
18+
<directory suffix=".php">tests/Integration</directory>
19+
</testsuite>
20+
</testsuites>
21+
<listeners>
22+
<listener class="TestListener" file="tests/TestListener.php"/>
23+
</listeners>
2524
</phpunit>

0 commit comments

Comments
 (0)