Change the logic of the tests
This commit is contained in:
parent
769907d812
commit
855ecc3aa7
422
.github/workflows/woo.yml
vendored
422
.github/workflows/woo.yml
vendored
@ -21,408 +21,237 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
# WordPress 5.3
|
||||
|
||||
- php-version: '7.0'
|
||||
#PHP 7.0 and 7.3
|
||||
- php-version: '7.3'
|
||||
wp: '5.3'
|
||||
phpunit-version: 'phpunit:6.4.3'
|
||||
wc: '5.4.3'
|
||||
coverage: 1
|
||||
- php-version: '7.1'
|
||||
wp: '5.3'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.2'
|
||||
wp: '5.3'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.3'
|
||||
wp: '5.3'
|
||||
wc: '5.4.3'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.3'
|
||||
wc: '5.5.3'
|
||||
- php-version: '7.1'
|
||||
wp: '5.3'
|
||||
wc: '5.5.3'
|
||||
- php-version: '7.2'
|
||||
wp: '5.3'
|
||||
wc: '5.5.3'
|
||||
wc: '6.4.0'
|
||||
- php-version: '7.3'
|
||||
wp: '5.3'
|
||||
wc: '5.5.3'
|
||||
wc: '6.4.0'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.3'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.1'
|
||||
wp: '5.3'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.2'
|
||||
wp: '5.3'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.3'
|
||||
wp: '5.3'
|
||||
wc: '5.6.1'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.3'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.1'
|
||||
wp: '5.3'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.2'
|
||||
wp: '5.3'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.3'
|
||||
wp: '5.3'
|
||||
wc: '5.7.1'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.3'
|
||||
wc: '5.8.0'
|
||||
#PHP 7.1 and 7.2
|
||||
- php-version: '7.1'
|
||||
wp: '5.3'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.2'
|
||||
wp: '5.3'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.3'
|
||||
- php-version: '7.1'
|
||||
wp: '5.3'
|
||||
wc: '5.8.0'
|
||||
|
||||
## WordPress 5.4
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.4'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.1'
|
||||
wp: '5.4'
|
||||
wc: '5.4.3'
|
||||
wc: '6.0.0'
|
||||
- php-version: '7.2'
|
||||
wp: '5.3'
|
||||
wc: '6.0.0'
|
||||
|
||||
# WordPress 5.4
|
||||
#PHP 7.0 and 7.3
|
||||
- php-version: '7.3'
|
||||
wp: '5.4'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.3'
|
||||
wp: '5.4'
|
||||
wc: '5.4.3'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.4'
|
||||
wc: '5.5.3'
|
||||
- php-version: '7.1'
|
||||
wp: '5.4'
|
||||
wc: '5.5.3'
|
||||
- php-version: '7.2'
|
||||
wp: '5.4'
|
||||
wc: '5.5.3'
|
||||
wc: '6.4.0'
|
||||
- php-version: '7.3'
|
||||
wp: '5.4'
|
||||
wc: '5.5.3'
|
||||
wc: '6.4.0'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.4'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.1'
|
||||
wp: '5.4'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.2'
|
||||
wp: '5.4'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.3'
|
||||
wp: '5.4'
|
||||
wc: '5.6.1'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.4'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.1'
|
||||
wp: '5.4'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.2'
|
||||
wp: '5.4'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.3'
|
||||
wp: '5.4'
|
||||
wc: '5.7.1'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.4'
|
||||
wc: '5.8.0'
|
||||
#PHP 7.1 and 7.2
|
||||
- php-version: '7.1'
|
||||
wp: '5.4'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.2'
|
||||
wp: '5.4'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.3'
|
||||
- php-version: '7.1'
|
||||
wp: '5.4'
|
||||
wc: '5.8.0'
|
||||
|
||||
## WordPress 5.5
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.5'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.1'
|
||||
wp: '5.5'
|
||||
wc: '5.4.3'
|
||||
wc: '6.0.0'
|
||||
- php-version: '7.2'
|
||||
wp: '5.4'
|
||||
wc: '6.0.0'
|
||||
|
||||
# WordPress 5.5
|
||||
#PHP 7.0 and 7.3
|
||||
- php-version: '7.3'
|
||||
wp: '5.5'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.3'
|
||||
wp: '5.5'
|
||||
wc: '5.4.3'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.5'
|
||||
wc: '5.5.3'
|
||||
- php-version: '7.1'
|
||||
wp: '5.5'
|
||||
wc: '5.5.3'
|
||||
- php-version: '7.2'
|
||||
wp: '5.5'
|
||||
wc: '5.5.3'
|
||||
wc: '6.4.0'
|
||||
- php-version: '7.3'
|
||||
wp: '5.5'
|
||||
wc: '5.5.3'
|
||||
wc: '6.4.0'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.5'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.1'
|
||||
wp: '5.5'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.2'
|
||||
wp: '5.5'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.3'
|
||||
wp: '5.5'
|
||||
wc: '5.6.1'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.5'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.1'
|
||||
wp: '5.5'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.2'
|
||||
wp: '5.5'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.3'
|
||||
wp: '5.5'
|
||||
wc: '5.7.1'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.5'
|
||||
wc: '5.8.0'
|
||||
#PHP 7.1 and 7.2
|
||||
- php-version: '7.1'
|
||||
wp: '5.5'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.2'
|
||||
wp: '5.5'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.3'
|
||||
wp: '5.5'
|
||||
wc: '5.8.0'
|
||||
|
||||
## WordPress 5.6
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.6'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.1'
|
||||
wp: '5.6'
|
||||
wc: '5.4.3'
|
||||
wp: '5.5'
|
||||
wc: '6.0.0'
|
||||
- php-version: '7.2'
|
||||
wp: '5.5'
|
||||
wc: '6.0.0'
|
||||
|
||||
# WordPress 5.6
|
||||
#PHP 7.0 and 7.3
|
||||
- php-version: '7.3'
|
||||
wp: '5.6'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.3'
|
||||
wp: '5.6'
|
||||
wc: '5.4.3'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.6'
|
||||
wc: '5.5.3'
|
||||
- php-version: '7.1'
|
||||
wp: '5.6'
|
||||
wc: '5.5.3'
|
||||
- php-version: '7.2'
|
||||
wp: '5.6'
|
||||
wc: '5.5.3'
|
||||
wc: '6.4.0'
|
||||
- php-version: '7.3'
|
||||
wp: '5.6'
|
||||
wc: '5.5.3'
|
||||
wc: '6.4.0'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.6'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.1'
|
||||
wp: '5.6'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.2'
|
||||
wp: '5.6'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.3'
|
||||
wp: '5.6'
|
||||
wc: '5.6.1'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.6'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.1'
|
||||
wp: '5.6'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.2'
|
||||
wp: '5.6'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.3'
|
||||
wp: '5.6'
|
||||
wc: '5.7.1'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.6'
|
||||
wc: '5.8.0'
|
||||
#PHP 7.1 and 7.2
|
||||
- php-version: '7.1'
|
||||
wp: '5.6'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.2'
|
||||
wp: '5.6'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.3'
|
||||
wp: '5.6'
|
||||
wc: '5.8.0'
|
||||
|
||||
## WordPress 5.7
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.7'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.1'
|
||||
wp: '5.7'
|
||||
wc: '5.4.3'
|
||||
wp: '5.6'
|
||||
wc: '6.0.0'
|
||||
- php-version: '7.2'
|
||||
wp: '5.6'
|
||||
wc: '6.0.0'
|
||||
|
||||
# WordPress 5.7
|
||||
#PHP 7.0 and 7.3
|
||||
- php-version: '7.3'
|
||||
wp: '5.7'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.3'
|
||||
wp: '5.7'
|
||||
wc: '5.4.3'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.7'
|
||||
wc: '5.5.3'
|
||||
- php-version: '7.1'
|
||||
wp: '5.7'
|
||||
wc: '5.5.3'
|
||||
- php-version: '7.2'
|
||||
wp: '5.7'
|
||||
wc: '5.5.3'
|
||||
wc: '6.4.0'
|
||||
- php-version: '7.3'
|
||||
wp: '5.7'
|
||||
wc: '5.5.3'
|
||||
wc: '6.4.0'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.7'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.1'
|
||||
wp: '5.7'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.2'
|
||||
wp: '5.7'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.3'
|
||||
wp: '5.7'
|
||||
wc: '5.6.1'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.7'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.1'
|
||||
wp: '5.7'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.2'
|
||||
wp: '5.7'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.3'
|
||||
wp: '5.7'
|
||||
wc: '5.7.1'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.7'
|
||||
wc: '5.8.0'
|
||||
#PHP 7.1 and 7.2
|
||||
- php-version: '7.1'
|
||||
wp: '5.7'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.2'
|
||||
wp: '5.7'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.3'
|
||||
wp: '5.7'
|
||||
wc: '5.8.0'
|
||||
|
||||
## WordPress 5.8
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.8'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.1'
|
||||
wp: '5.8'
|
||||
wc: '5.4.3'
|
||||
wp: '5.7'
|
||||
wc: '6.0.0'
|
||||
- php-version: '7.2'
|
||||
wp: '5.7'
|
||||
wc: '6.0.0'
|
||||
|
||||
# WordPress 5.8
|
||||
#PHP 7.0 and 7.3
|
||||
- php-version: '7.3'
|
||||
wp: '5.8'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.3'
|
||||
wp: '5.8'
|
||||
wc: '5.4.3'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.8'
|
||||
wc: '5.5.3'
|
||||
- php-version: '7.1'
|
||||
wp: '5.8'
|
||||
wc: '5.5.3'
|
||||
- php-version: '7.2'
|
||||
wp: '5.8'
|
||||
wc: '5.5.3'
|
||||
wc: '6.4.0'
|
||||
- php-version: '7.3'
|
||||
wp: '5.8'
|
||||
wc: '5.5.3'
|
||||
wc: '6.4.0'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.8'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.1'
|
||||
wp: '5.8'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.2'
|
||||
wp: '5.8'
|
||||
wc: '5.6.1'
|
||||
- php-version: '7.3'
|
||||
wp: '5.8'
|
||||
wc: '5.6.1'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.8'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.1'
|
||||
wp: '5.8'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.2'
|
||||
wp: '5.8'
|
||||
wc: '5.7.1'
|
||||
- php-version: '7.3'
|
||||
wp: '5.8'
|
||||
wc: '5.7.1'
|
||||
|
||||
- php-version: '7.0'
|
||||
wp: '5.8'
|
||||
wc: '5.8.0'
|
||||
#PHP 7.1 and 7.2
|
||||
- php-version: '7.1'
|
||||
wp: '5.8'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.2'
|
||||
wp: '5.8'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.3'
|
||||
- php-version: '7.1'
|
||||
wp: '5.8'
|
||||
wc: '6.0.0'
|
||||
- php-version: '7.2'
|
||||
wp: '5.8'
|
||||
wc: '6.0.0'
|
||||
|
||||
# WordPress 5.9
|
||||
#PHP 7.0 and 7.3
|
||||
- php-version: '7.3'
|
||||
wp: '5.9'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.3'
|
||||
wp: '5.9'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.0'
|
||||
wp: '5.9'
|
||||
wc: '6.4.0'
|
||||
- php-version: '7.3'
|
||||
wp: '5.9'
|
||||
wc: '6.4.0'
|
||||
|
||||
#PHP 7.1 and 7.2
|
||||
- php-version: '7.1'
|
||||
wp: '5.9'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.2'
|
||||
wp: '5.9'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.1'
|
||||
wp: '5.9'
|
||||
wc: '6.0.0'
|
||||
- php-version: '7.2'
|
||||
wp: '5.9'
|
||||
wc: '6.0.0'
|
||||
|
||||
# WordPress 6.0
|
||||
#PHP 7.0 and 7.3
|
||||
- php-version: '7.3'
|
||||
wp: '6.0'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.3'
|
||||
wp: '6.0'
|
||||
wc: '5.4.3'
|
||||
- php-version: '7.0'
|
||||
wp: '6.0'
|
||||
wc: '6.4.0'
|
||||
- php-version: '7.3'
|
||||
wp: '6.0'
|
||||
wc: '6.4.0'
|
||||
|
||||
#PHP 7.1 and 7.2
|
||||
- php-version: '7.1'
|
||||
wp: '6.0'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.2'
|
||||
wp: '6.0'
|
||||
wc: '5.8.0'
|
||||
- php-version: '7.1'
|
||||
wp: '6.0'
|
||||
wc: '6.0.0'
|
||||
- php-version: '7.2'
|
||||
wp: '6.0'
|
||||
wc: '6.0.0'
|
||||
|
||||
services:
|
||||
mysql:
|
||||
@ -450,6 +279,11 @@ jobs:
|
||||
composer --version
|
||||
phpunit --version
|
||||
|
||||
- name: Install Polyfills dependency for WP 5.9 and 6.0
|
||||
if: ${{ matrix.wp }} == '6.0' || ${{ matrix.wp }} == '5.9'
|
||||
run: |
|
||||
composer require --dev yoast/phpunit-polyfills --ignore-platform-reqs
|
||||
|
||||
- name: Install Woocommerce
|
||||
env:
|
||||
WP_VERSION: ${{ matrix.wp }}
|
||||
@ -517,4 +351,4 @@ jobs:
|
||||
make svn_push
|
||||
- name: Cleanup
|
||||
if: env.LAST_TAG != env.RELEASE_TAG
|
||||
run: make remove_dir
|
||||
run: make remove_dir
|
||||
|
@ -10,13 +10,13 @@
|
||||
],
|
||||
"minimum-stability": "dev",
|
||||
"require": {
|
||||
"ext-simplexml": "*",
|
||||
"ext-xmlwriter": "*"
|
||||
"ext-simplexml": "*",
|
||||
"ext-xmlwriter": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-simplexml": "*",
|
||||
"phpunit/phpunit": "6.*"
|
||||
"phpunit/phpunit": "6.*",
|
||||
"yoast/phpunit-polyfills": "1.x-dev"
|
||||
}
|
||||
}
|
||||
|
78
composer.lock
generated
78
composer.lock
generated
@ -1,10 +1,10 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "07140d4f252afbd8967311bfadf35ede",
|
||||
"content-hash": "0352c9d2a1063ea65868246bee006dcb",
|
||||
"packages": [],
|
||||
"packages-dev": [
|
||||
{
|
||||
@ -819,6 +819,7 @@
|
||||
"mock",
|
||||
"xunit"
|
||||
],
|
||||
"abandoned": true,
|
||||
"time": "2018-01-07T17:10:51+00:00"
|
||||
},
|
||||
{
|
||||
@ -1469,13 +1470,80 @@
|
||||
"validate"
|
||||
],
|
||||
"time": "2018-04-19T15:46:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "yoast/phpunit-polyfills",
|
||||
"version": "dev-develop",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Yoast/PHPUnit-Polyfills.git",
|
||||
"reference": "b0c727ed3fb2a6c4528c676af69651ec4f579655"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/b0c727ed3fb2a6c4528c676af69651ec4f579655",
|
||||
"reference": "b0c727ed3fb2a6c4528c676af69651ec4f579655",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4",
|
||||
"phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"yoast/yoastcs": "^2.2.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.x-dev",
|
||||
"dev-develop": "1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"phpunitpolyfills-autoload.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Team Yoast",
|
||||
"email": "support@yoast.com",
|
||||
"homepage": "https://yoast.com"
|
||||
},
|
||||
{
|
||||
"name": "Contributors",
|
||||
"homepage": "https://github.com/Yoast/PHPUnit-Polyfills/graphs/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests",
|
||||
"homepage": "https://github.com/Yoast/PHPUnit-Polyfills",
|
||||
"keywords": [
|
||||
"phpunit",
|
||||
"polyfill",
|
||||
"testing"
|
||||
],
|
||||
"time": "2022-08-03T05:59:50+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
"minimum-stability": "dev",
|
||||
"stability-flags": [],
|
||||
"stability-flags": {
|
||||
"yoast/phpunit-polyfills": 20
|
||||
},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": []
|
||||
"platform": {
|
||||
"ext-simplexml": "*",
|
||||
"ext-xmlwriter": "*"
|
||||
},
|
||||
"platform-dev": {
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-simplexml": "*"
|
||||
},
|
||||
"plugin-api-version": "1.1.0"
|
||||
}
|
||||
|
@ -104,6 +104,11 @@ if (!class_exists('WC_Retailcrm_History')) :
|
||||
|
||||
do {
|
||||
$historyResponse = $this->retailcrm->customersHistory($filter);
|
||||
$isLastPage = $this->checkTotalPage($pagination, $historyResponse);
|
||||
|
||||
if ($isLastPage) {
|
||||
break;
|
||||
}
|
||||
|
||||
$history = $this->getHistoryData($historyResponse);
|
||||
|
||||
@ -213,6 +218,11 @@ if (!class_exists('WC_Retailcrm_History')) :
|
||||
|
||||
do {
|
||||
$historyResponse = $this->retailcrm->OrdersHistory($filter);
|
||||
$isLastPage = $this->checkTotalPage($pagination, $historyResponse);
|
||||
|
||||
if ($isLastPage) {
|
||||
break;
|
||||
}
|
||||
|
||||
$history = $this->getHistoryData($historyResponse);
|
||||
|
||||
@ -1449,6 +1459,23 @@ if (!class_exists('WC_Retailcrm_History')) :
|
||||
|
||||
return $historyResponse['history'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $currentPage
|
||||
* @param WC_Retailcrm_Response $historyResponse Responce from CRM
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function checkTotalPage($currentPage, $historyResponse): bool
|
||||
{
|
||||
$totalPageCount = $historyResponse['pagination']['totalPageCount'] ?? null;
|
||||
|
||||
if (empty($totalPageCount)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $currentPage > $totalPageCount;
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Version: 4.5.0
|
||||
* Tested up to: 6.0
|
||||
* WC requires at least: 5.4
|
||||
* WC tested up to: 6.7
|
||||
* WC tested up to: 6.9
|
||||
* Text Domain: retailcrm
|
||||
*/
|
||||
|
||||
|
@ -12,19 +12,19 @@ WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib}
|
||||
WP_CORE_DIR=${WP_CORE_DIR-/tmp/wordpress/}
|
||||
|
||||
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]]; then
|
||||
WP_TESTS_TAG="tags/$WP_VERSION"
|
||||
WP_TESTS_TAG="tags/$WP_VERSION"
|
||||
elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
|
||||
WP_TESTS_TAG="trunk"
|
||||
WP_TESTS_TAG="trunk"
|
||||
else
|
||||
# http serves a single offer, whereas https serves multiple. we only want one
|
||||
download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json
|
||||
grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json
|
||||
LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//')
|
||||
if [[ -z "$LATEST_VERSION" ]]; then
|
||||
echo "Latest WordPress version could not be found"
|
||||
exit 1
|
||||
fi
|
||||
WP_TESTS_TAG="tags/$LATEST_VERSION"
|
||||
# http serves a single offer, whereas https serves multiple. we only want one
|
||||
download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json
|
||||
grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json
|
||||
LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//')
|
||||
if [[ -z "$LATEST_VERSION" ]]; then
|
||||
echo "Latest WordPress version could not be found"
|
||||
exit 1
|
||||
fi
|
||||
WP_TESTS_TAG="tags/$LATEST_VERSION"
|
||||
fi
|
||||
|
||||
set -ex
|
||||
@ -38,15 +38,15 @@ download() {
|
||||
}
|
||||
|
||||
install_wp() {
|
||||
if [ -d $WP_CORE_DIR ]; then
|
||||
return;
|
||||
fi
|
||||
if [ -d $WP_CORE_DIR ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
mkdir -p $WP_CORE_DIR
|
||||
local ARCHIVE_NAME="wordpress-$WP_VERSION"
|
||||
download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz
|
||||
tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR
|
||||
download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php
|
||||
mkdir -p $WP_CORE_DIR
|
||||
local ARCHIVE_NAME="wordpress-$WP_VERSION"
|
||||
download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz
|
||||
tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR
|
||||
download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php
|
||||
}
|
||||
|
||||
install_woocommerce() {
|
||||
@ -57,37 +57,43 @@ install_woocommerce() {
|
||||
git clone https://github.com/woocommerce/woocommerce.git
|
||||
cd woocommerce
|
||||
git checkout $WC_VERSION
|
||||
|
||||
# In 6.x.x versions WooCommerce changed structure project, for install need move to plugins/woocommerce directory
|
||||
if [[ "$WC_VERSION" =~ .*"6.".* ]]; then
|
||||
cd plugins/woocommerce
|
||||
fi;
|
||||
|
||||
composer install --ignore-platform-reqs
|
||||
cd -
|
||||
cd /tmp
|
||||
fi
|
||||
}
|
||||
|
||||
install_test_suite() {
|
||||
# portable in-place argument for both GNU sed and Mac OSX sed
|
||||
if [[ $(uname -s) == 'Darwin' ]]; then
|
||||
local ioption='-i .bak'
|
||||
else
|
||||
local ioption='-i'
|
||||
fi
|
||||
# portable in-place argument for both GNU sed and Mac OSX sed
|
||||
if [[ $(uname -s) == 'Darwin' ]]; then
|
||||
local ioption='-i .bak'
|
||||
else
|
||||
local ioption='-i'
|
||||
fi
|
||||
|
||||
# set up testing suite if it doesn't yet exist
|
||||
if [ ! -d $WP_TESTS_DIR ]; then
|
||||
# set up testing suite
|
||||
mkdir -p $WP_TESTS_DIR
|
||||
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
|
||||
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data
|
||||
fi
|
||||
# set up testing suite if it doesn't yet exist
|
||||
if [ ! -d $WP_TESTS_DIR ]; then
|
||||
# set up testing suite
|
||||
mkdir -p $WP_TESTS_DIR
|
||||
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
|
||||
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data
|
||||
fi
|
||||
|
||||
if [ ! -f wp-tests-config.php ]; then
|
||||
download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php
|
||||
# remove all forward slashes in the end
|
||||
WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::")
|
||||
sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php
|
||||
sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php
|
||||
sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php
|
||||
sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php
|
||||
sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php
|
||||
fi
|
||||
if [ ! -f wp-tests-config.php ]; then
|
||||
download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php
|
||||
# remove all forward slashes in the end
|
||||
WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::")
|
||||
sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php
|
||||
sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php
|
||||
sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php
|
||||
sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php
|
||||
sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php
|
||||
fi
|
||||
}
|
||||
|
||||
install_db() {
|
||||
|
@ -1,45 +1,75 @@
|
||||
<?php
|
||||
|
||||
$_tests_dir = getenv('WP_TESTS_DIR');
|
||||
$_output_logs_to_stdout = getenv('MODULE_LOGS_TO_STDOUT');
|
||||
$_wcOldBootstrap = '/tmp/woocommerce/tests/bootstrap.php';
|
||||
$_wcNewBootstrap = '/tmp/woocommerce/tests/legacy/bootstrap.php';
|
||||
$wpVersion = getenv('WP_VERSION');
|
||||
|
||||
if (!$_tests_dir) {
|
||||
$_tests_dir = '/tmp/wordpress-tests-lib';
|
||||
if (empty($wpVersion)) {
|
||||
die('WP version is empty!');
|
||||
}
|
||||
|
||||
require_once $_tests_dir . '/includes/functions.php';
|
||||
$pluginDirectory = dirname(dirname(__FILE__)) . '/';
|
||||
|
||||
function _manually_load_plugin() {
|
||||
$plugin_dir = dirname(dirname(__FILE__)) . '/';
|
||||
|
||||
require $plugin_dir . 'src/include/class-wc-retailcrm-orders.php';
|
||||
require $plugin_dir . 'src/include/class-wc-retailcrm-customers.php';
|
||||
require $plugin_dir . 'src/include/class-wc-retailcrm-inventories.php';
|
||||
require $plugin_dir . 'src/include/class-wc-retailcrm-ga.php';
|
||||
require $plugin_dir . 'src/include/class-wc-retailcrm-daemon-collector.php';
|
||||
require $plugin_dir . 'src/include/class-wc-retailcrm-history.php';
|
||||
require $plugin_dir . 'src/include/class-wc-retailcrm-icml.php';
|
||||
require $plugin_dir . 'src/retailcrm.php';
|
||||
// Require for WP 5.9 and 6.0 versions
|
||||
if ($wpVersion === '5.9' || $wpVersion === '6.0') {
|
||||
echo 'Test';
|
||||
require_once $pluginDirectory . 'vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php';
|
||||
echo 'Test1';
|
||||
}
|
||||
|
||||
$testsDir = getenv('WP_TESTS_DIR');
|
||||
|
||||
if (!$testsDir) {
|
||||
$testsDir = '/tmp/wordpress-tests-lib';
|
||||
}
|
||||
|
||||
require_once $testsDir . '/includes/functions.php';
|
||||
|
||||
tests_add_filter('muplugins_loaded', '_manually_load_plugin');
|
||||
|
||||
if (file_exists($_wcOldBootstrap)) {
|
||||
require $_wcOldBootstrap;
|
||||
} elseif (file_exists($_wcNewBootstrap)) {
|
||||
require $_wcNewBootstrap;
|
||||
$wcVersion = getenv('WC_VERSION');
|
||||
|
||||
if (empty($wcVersion)) {
|
||||
die('WC version is empty!');
|
||||
}
|
||||
|
||||
$plugin_dir = dirname(dirname(__FILE__)) . '/';
|
||||
if ($wcVersion[0] === '6') {
|
||||
$wcOldBootstrap = '/tmp/woocommerce/plugins/woocommerce/tests/bootstrap.php';
|
||||
$wcNewBootstrap = '/tmp/woocommerce/plugins/woocommerce/tests/legacy/bootstrap.php';
|
||||
} else {
|
||||
$wcOldBootstrap = '/tmp/woocommerce/tests/bootstrap.php';
|
||||
$wcNewBootstrap = '/tmp/woocommerce/tests/legacy/bootstrap.php';
|
||||
}
|
||||
|
||||
if (file_exists($wcOldBootstrap)) {
|
||||
require_once $wcOldBootstrap;
|
||||
} elseif (file_exists($wcNewBootstrap)) {
|
||||
require_once $wcNewBootstrap;
|
||||
}
|
||||
|
||||
$outputLogsStdout = getenv('MODULE_LOGS_TO_STDOUT');
|
||||
|
||||
// helpers
|
||||
require $plugin_dir . 'src/include/components/class-wc-retailcrm-logger.php';
|
||||
require $plugin_dir . 'tests/helpers/class-wc-retailcrm-response-helper.php';
|
||||
require $plugin_dir . 'tests/helpers/class-wc-retailcrm-test-case-helper.php';
|
||||
require $plugin_dir . 'tests/helpers/class-wc-retailcrm-log-handler-stdout.php';
|
||||
require_once $pluginDirectory . 'src/include/components/class-wc-retailcrm-logger.php';
|
||||
require_once $pluginDirectory . 'tests/helpers/class-wc-retailcrm-response-helper.php';
|
||||
require_once $pluginDirectory . 'tests/helpers/class-wc-retailcrm-test-case-helper.php';
|
||||
require_once $pluginDirectory . 'tests/helpers/class-wc-retailcrm-log-handler-stdout.php';
|
||||
|
||||
if (!empty($_output_logs_to_stdout) && $_output_logs_to_stdout == '1') {
|
||||
WC_Retailcrm_Logger::setAdditionalHandlers(array(new WC_Retailcrm_Log_Handler_Stdout()));
|
||||
if (!empty($outputLogsStdout) && $outputLogsStdout == '1') {
|
||||
WC_Retailcrm_Logger::setAdditionalHandlers([new WC_Retailcrm_Log_Handler_Stdout()]);
|
||||
}
|
||||
|
||||
// Call after require WooCommerce bootstrap
|
||||
function _manually_load_plugin()
|
||||
{
|
||||
$pluginDirectory = dirname(dirname(__FILE__)) . '/';
|
||||
|
||||
require_once $pluginDirectory . 'src/include/class-wc-retailcrm-customers.php';
|
||||
require_once $pluginDirectory . 'src/include/class-wc-retailcrm-daemon-collector.php';
|
||||
require_once $pluginDirectory . 'src/include/class-wc-retailcrm-ga.php';
|
||||
require_once $pluginDirectory . 'src/include/class-wc-retailcrm-history.php';
|
||||
require_once $pluginDirectory . 'src/include/class-wc-retailcrm-icml.php';
|
||||
require_once $pluginDirectory . 'src/include/class-wc-retailcrm-inventories.php';
|
||||
require_once $pluginDirectory . 'src/include/class-wc-retailcrm-orders.php';
|
||||
require_once $pluginDirectory . 'src/include/class-wc-retailcrm-plugin.php';
|
||||
require_once $pluginDirectory . 'src/include/class-wc-retailcrm-uploader.php';
|
||||
require_once $pluginDirectory . 'src/retailcrm.php';
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper
|
||||
|
||||
$retailcrm_history->getHistory();
|
||||
|
||||
$orders = wc_get_orders(array( 'numberposts' => - 1 ));
|
||||
$orders = wc_get_orders(['numberposts' => - 1]);
|
||||
$wcOrder = end($orders);
|
||||
$options = get_option(\WC_Retailcrm_Base::$option_key);
|
||||
|
||||
@ -140,7 +140,7 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper
|
||||
$retailcrm_history = new \WC_Retailcrm_History($this->apiMock);
|
||||
$retailcrm_history->getHistory();
|
||||
|
||||
$orders = wc_get_orders(array('numberposts' => -1));
|
||||
$orders = wc_get_orders(['numberposts' => -1]);
|
||||
$order_added = end($orders);
|
||||
|
||||
if (!$order_added) {
|
||||
@ -433,7 +433,7 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper
|
||||
DataHistoryRetailCrm::get_order_with_customer_and_contact(
|
||||
DataHistoryRetailCrm::get_new_corporate_for_order(),
|
||||
DataHistoryRetailCrm::get_new_contact_for_order(),
|
||||
array('name' => 'Компания1'),
|
||||
['name' => 'Компания1'],
|
||||
'legal-entity'
|
||||
)
|
||||
);
|
||||
@ -496,7 +496,7 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper
|
||||
DataHistoryRetailCrm::get_order_with_customer_and_contact(
|
||||
DataHistoryRetailCrm::get_another_corporate_for_order(),
|
||||
DataHistoryRetailCrm::get_another_contact_for_order(),
|
||||
array('name' => 'TestCompany3428769'),
|
||||
['name' => 'TestCompany3428769'],
|
||||
'legal-entity'
|
||||
)
|
||||
);
|
||||
@ -560,7 +560,7 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper
|
||||
DataHistoryRetailCrm::get_order_with_customer_and_contact(
|
||||
DataHistoryRetailCrm::get_another_corporate_for_order(),
|
||||
DataHistoryRetailCrm::get_another_contact_for_order(),
|
||||
array('name' => 'TestCompany017089465'),
|
||||
['name' => 'TestCompany017089465'],
|
||||
'legal-entity'
|
||||
)
|
||||
);
|
||||
@ -624,7 +624,7 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper
|
||||
DataHistoryRetailCrm::get_order_with_customer_and_contact(
|
||||
DataHistoryRetailCrm::get_another_corporate_for_order(),
|
||||
DataHistoryRetailCrm::get_contact_when_only_contact_changed(),
|
||||
array('name' => 'TestCompany017089465'),
|
||||
['name' => 'TestCompany017089465'],
|
||||
'legal-entity'
|
||||
)
|
||||
);
|
||||
@ -798,17 +798,17 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper
|
||||
{
|
||||
$this->apiMock = $this->getMockBuilder('\WC_Retailcrm_Proxy')
|
||||
->disableOriginalConstructor()
|
||||
->setMethods(array('ordersHistory', 'customersHistory', 'ordersGet'))
|
||||
->setMethods(['ordersHistory', 'customersHistory', 'ordersGet'])
|
||||
->getMock();
|
||||
|
||||
$this->customersHistoryResponse = $this->getMockBuilder('\WC_Retailcrm_Response_Helper')
|
||||
->disableOriginalConstructor()
|
||||
->setMethods(array('isSuccessful'))
|
||||
->setMethods(['isSuccessful'])
|
||||
->getMock();
|
||||
|
||||
$this->ordersHistoryResponse = $this->getMockBuilder('\WC_Retailcrm_Response_Helper')
|
||||
->disableOriginalConstructor()
|
||||
->setMethods(array('isSuccessful'))
|
||||
->setMethods(['isSuccessful'])
|
||||
->getMock();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user