From 084e3428f4bffe7c1fbbd7265f8d875a50e48084 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 15:31:30 +0200 Subject: [PATCH 01/29] Test all WordPress versions from 4.4.* --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c605d0c..884b52d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,8 @@ jobs: matrix: operating-system: [ ubuntu-latest ] php-versions: [ '7.1', '7.2', '7.3' ] - name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} + wordpress-versions: [ '5.4.1', '5.3.3','5.2.6', '5.1.5','5.0.9', '4.9.14', '4.8.13', '4.7.17', '4.6.18', '4.5.21', '4.4.22','latest' ] + name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} and WP ${{matrix.wordpress-versions}} steps: - name: Checkout uses: actions/checkout@v1 @@ -40,7 +41,7 @@ jobs: run: php -v - name: Install WP Tests - run: bash bin/install-wp-tests.sh wordpress_test root root localhost latest + run: bash bin/install-wp-tests.sh wordpress_test root root localhost ${{matrix.wordpress-versions}} - name: phpunit tests run: phpunit \ No newline at end of file From 513e85ac856b2070dd479e94f308deea2da1ac0d Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 15:37:29 +0200 Subject: [PATCH 02/29] Do not fail fast :) --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 884b52d..749d0a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: - 3306/tcp options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 strategy: + fail-fast: false matrix: operating-system: [ ubuntu-latest ] php-versions: [ '7.1', '7.2', '7.3' ] From 715fbb0d81b034f9006cebff68c992ec79525ce4 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 20:35:40 +0200 Subject: [PATCH 03/29] limit at 2 execution --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 749d0a4..ccfa8de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: - 3306/tcp options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 strategy: + max-parallel: 2 fail-fast: false matrix: operating-system: [ ubuntu-latest ] From a3a4ca61099ba6ff0b08fce5801039a817eba30e Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 21:09:17 +0200 Subject: [PATCH 04/29] Limit github actions for php versions and WP --- .github/workflows/ci.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ccfa8de..60a17a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,12 +16,16 @@ jobs: - 3306/tcp options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 strategy: - max-parallel: 2 fail-fast: false matrix: operating-system: [ ubuntu-latest ] - php-versions: [ '7.1', '7.2', '7.3' ] - wordpress-versions: [ '5.4.1', '5.3.3','5.2.6', '5.1.5','5.0.9', '4.9.14', '4.8.13', '4.7.17', '4.6.18', '4.5.21', '4.4.22','latest' ] + #php-versions: [ '7.1', '7.2', '7.3', '7.4' ] + php-versions: [ '7.3' ] + #wordpress-versions: [ '5.4.1', '5.3.3','5.2.6', '5.1.5','5.0.9', '4.9.14', '4.8.13', '4.7.17', '4.6.18', '4.5.21', '4.4.22','latest' ] + wordpress-versions: [ '4.4.22','latest' ] + exclude: + - wordpress-versions: '4.4.22' + php-versions: '7.3' name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} and WP ${{matrix.wordpress-versions}} steps: - name: Checkout From d425259c96bcd25f88f7a7d5ccc85b0d4c0945b8 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 21:46:49 +0200 Subject: [PATCH 05/29] Split up tests, remove files after test ended --- tests/test-plugin.php | 69 +++++++++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 25 deletions(-) diff --git a/tests/test-plugin.php b/tests/test-plugin.php index a329c47..9343b38 100644 --- a/tests/test-plugin.php +++ b/tests/test-plugin.php @@ -6,20 +6,48 @@ */ /** - * Sample test case. + * Basic plugin tests. */ class WP_HTTP_BLACKLIST extends WP_UnitTestCase { + private function filter_file_redable() { + add_filter('wp_http_blacklist_file', function() { + @unlink( __DIR__.'/blacklist_readable.txt' ); + file_put_contents( __DIR__.'/blacklist_readable.txt', + 'google.fr + beapi.fr + ' + ); + return __DIR__.'/blacklist_readable.txt'; + }); + } + + private function filter_file_unredable() { + add_filter('wp_http_blacklist_file', function() { + @unlink( __DIR__.'/blacklist_unreadable.txt' ); + file_put_contents( __DIR__.'/blacklist_unreadable.txt', + 'google.fr + beapi.fr + ' + ); + chmod( __DIR__.'/blacklist_unreadable.txt', 0377 ); + return __DIR__.'/blacklist_unreadable.txt'; + }); + } - /** - * A single example test. - */ - public function test_default() { + public function test_blacklisted() { // Replace this with some actual testing code. $result = wp_remote_get('https://connect.advancedcustomfields.com'); $this->assertTrue( is_wp_error( $result ) ); } + public function test_not_blacklisted() { + // Replace this with some actual testing code. + $result = wp_remote_get('https://google.fr'); + + $this->assertFalse( is_wp_error( $result ) ); + } + public function test_filter() { add_filter('wp_http_blacklist', function( $blacklist ) { $blacklist[] = 'google.fr'; @@ -33,15 +61,7 @@ public function test_filter() { } public function test_file_readable() { - add_filter('wp_http_blacklist_file', function() { - @unlink( __DIR__.'/blacklist_readable.txt' ); - file_put_contents( __DIR__.'/blacklist_readable.txt', - 'google.fr - beapi.fr - ' - ); - return __DIR__.'/blacklist_readable.txt'; - }); + $this->filter_file_redable(); // New entry with space ok $result = wp_remote_get('https://google.fr'); @@ -53,28 +73,27 @@ public function test_file_readable() { $this->assertTrue( is_wp_error( $result ) ); $this->assertEquals( $result->get_error_code(), 'http_request_blocked' ); + @unlink( __DIR__.'/blacklist_readable.txt' ); + } + + public function test_file_readable_removed_default_blocked() { + $this->filter_file_redable(); // Old entry ok $result = wp_remote_get('https://connect.advancedcustomfields.com'); $this->assertFalse( is_wp_error( $result ) ); + + @unlink( __DIR__.'/blacklist_readable.txt' ); + } public function test_file_unreadable() { - add_filter('wp_http_blacklist_file', function() { - @unlink( __DIR__.'/blacklist_unreadable.txt' ); - file_put_contents( __DIR__.'/blacklist_unreadable.txt', - 'google.fr - beapi.fr - ' - ); - chmod( __DIR__.'/blacklist_unreadable.txt', 0377 ); - return __DIR__.'/blacklist_unreadable.txt'; - }); + $this->filter_file_unredable(); // New entry with space ok $result = wp_remote_get('https://google.fr'); $this->assertFalse( is_wp_error( $result ) ); - + @unlink( __DIR__.'/blacklist_unreadable.txt' ); } } From 7cf411f5723127a61b3485978294c6dd1bc7b8ac Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 21:52:04 +0200 Subject: [PATCH 06/29] restore all versions combinaisons --- .github/workflows/ci.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60a17a4..3b02c99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,13 +19,8 @@ jobs: fail-fast: false matrix: operating-system: [ ubuntu-latest ] - #php-versions: [ '7.1', '7.2', '7.3', '7.4' ] - php-versions: [ '7.3' ] - #wordpress-versions: [ '5.4.1', '5.3.3','5.2.6', '5.1.5','5.0.9', '4.9.14', '4.8.13', '4.7.17', '4.6.18', '4.5.21', '4.4.22','latest' ] - wordpress-versions: [ '4.4.22','latest' ] - exclude: - - wordpress-versions: '4.4.22' - php-versions: '7.3' + php-versions: [ '7.1', '7.2', '7.3', '7.4' ] + wordpress-versions: [ '5.4.1', '5.3.3','5.2.6', '5.1.5','5.0.9', '4.9.14', '4.8.13', '4.7.17', '4.6.18', '4.5.21', '4.4.22','latest' ] name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} and WP ${{matrix.wordpress-versions}} steps: - name: Checkout From 5025bcd068cf38ec76645fba133f8d73885b4952 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 22:16:41 +0200 Subject: [PATCH 07/29] Reorder all the matrix versions --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b02c99..e02114d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: matrix: operating-system: [ ubuntu-latest ] php-versions: [ '7.1', '7.2', '7.3', '7.4' ] - wordpress-versions: [ '5.4.1', '5.3.3','5.2.6', '5.1.5','5.0.9', '4.9.14', '4.8.13', '4.7.17', '4.6.18', '4.5.21', '4.4.22','latest' ] + wordpress-versions: [ '4.4.22', '4.5.21', '4.6.18', '4.7.17', '4.8.13', '4.9.14', '5.0.9', '5.1.5', '5.2.6', '5.3.3', '5.4.1', 'latest' ] name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} and WP ${{matrix.wordpress-versions}} steps: - name: Checkout From 85a3bbc86bf4b89a5f60c5f58f601d675bac9e4c Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 22:17:29 +0200 Subject: [PATCH 08/29] Rename actions --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e02114d..fdcc71c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: operating-system: [ ubuntu-latest ] php-versions: [ '7.1', '7.2', '7.3', '7.4' ] wordpress-versions: [ '4.4.22', '4.5.21', '4.6.18', '4.7.17', '4.8.13', '4.9.14', '5.0.9', '5.1.5', '5.2.6', '5.3.3', '5.4.1', 'latest' ] - name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} and WP ${{matrix.wordpress-versions}} + name: ${{ matrix.php-versions }}/${{matrix.wordpress-versions}} steps: - name: Checkout uses: actions/checkout@v1 From 20882312c330ace9d2cd32b0edd364da4f0a1542 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 22:20:58 +0200 Subject: [PATCH 09/29] Use phpunit version 7.5.20 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fdcc71c..e3490e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: extensions: mbstring, intl #optional, setup extensions ini-values: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration coverage: xdebug #optional, setup coverage driver - tools: psalm, phpcbf, phpcs, phpunit:5.7.27 + tools: psalm, phpcbf, phpcs, phpunit:7.5.20 - name: Start mysql service run: sudo /etc/init.d/mysql start From e8dc0d21b27741589cc5a71c9450293c0a2fa5c2 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 22:23:46 +0200 Subject: [PATCH 10/29] Specify testsuite name --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d9af975..09458d9 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,7 +8,7 @@ convertWarningsToExceptions="true" > - + ./tests/ From 163589356c8d349644ee63c9d53f10e0c471cb6a Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 22:44:52 +0200 Subject: [PATCH 11/29] Add phpunit globally --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3490e9..e95fa69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,13 +33,15 @@ jobs: extensions: mbstring, intl #optional, setup extensions ini-values: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration coverage: xdebug #optional, setup coverage driver - tools: psalm, phpcbf, phpcs, phpunit:7.5.20 - name: Start mysql service run: sudo /etc/init.d/mysql start - name: Check PHP Version run: php -v + + - name: Add PHPunit + run: composer global require phpunit/phpunit:7.5.20 - name: Install WP Tests run: bash bin/install-wp-tests.sh wordpress_test root root localhost ${{matrix.wordpress-versions}} From f843a130ead007f5050387d389031f9e9252e6b0 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 22:53:32 +0200 Subject: [PATCH 12/29] Do not test all WP versions, just latest --- .github/workflows/ci.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e95fa69..60a1e50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,6 @@ jobs: matrix: operating-system: [ ubuntu-latest ] php-versions: [ '7.1', '7.2', '7.3', '7.4' ] - wordpress-versions: [ '4.4.22', '4.5.21', '4.6.18', '4.7.17', '4.8.13', '4.9.14', '5.0.9', '5.1.5', '5.2.6', '5.3.3', '5.4.1', 'latest' ] name: ${{ matrix.php-versions }}/${{matrix.wordpress-versions}} steps: - name: Checkout @@ -33,18 +32,16 @@ jobs: extensions: mbstring, intl #optional, setup extensions ini-values: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration coverage: xdebug #optional, setup coverage driver + tools: phpunit:7.5.20 - name: Start mysql service run: sudo /etc/init.d/mysql start - name: Check PHP Version run: php -v - - - name: Add PHPunit - run: composer global require phpunit/phpunit:7.5.20 - name: Install WP Tests - run: bash bin/install-wp-tests.sh wordpress_test root root localhost ${{matrix.wordpress-versions}} + run: bash bin/install-wp-tests.sh wordpress_test root root localhost latest - name: phpunit tests run: phpunit \ No newline at end of file From 1e2aa7ed0e3b1940676cee480c95a995bcc6c52d Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 22:54:39 +0200 Subject: [PATCH 13/29] Rename action --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60a1e50..36e8e5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: matrix: operating-system: [ ubuntu-latest ] php-versions: [ '7.1', '7.2', '7.3', '7.4' ] - name: ${{ matrix.php-versions }}/${{matrix.wordpress-versions}} + name: PHP ${{ matrix.php-versions }} steps: - name: Checkout uses: actions/checkout@v1 @@ -39,7 +39,7 @@ jobs: - name: Check PHP Version run: php -v - + - name: Install WP Tests run: bash bin/install-wp-tests.sh wordpress_test root root localhost latest From 9593b4d6d372fe0295a33975d57d1c9c7ec377a1 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 23:16:38 +0200 Subject: [PATCH 14/29] debug on actions --- tests/test-plugin.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-plugin.php b/tests/test-plugin.php index 9343b38..791bdf6 100644 --- a/tests/test-plugin.php +++ b/tests/test-plugin.php @@ -82,6 +82,8 @@ public function test_file_readable_removed_default_blocked() { // Old entry ok $result = wp_remote_get('https://connect.advancedcustomfields.com'); $this->assertFalse( is_wp_error( $result ) ); + var_dump($result); + die(); @unlink( __DIR__.'/blacklist_readable.txt' ); From c709223fbba895d9e8f4b2b5a97845bbe5a97f8c Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 23:18:47 +0200 Subject: [PATCH 15/29] check is_wp_error return --- tests/test-plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-plugin.php b/tests/test-plugin.php index 791bdf6..f96582f 100644 --- a/tests/test-plugin.php +++ b/tests/test-plugin.php @@ -82,7 +82,7 @@ public function test_file_readable_removed_default_blocked() { // Old entry ok $result = wp_remote_get('https://connect.advancedcustomfields.com'); $this->assertFalse( is_wp_error( $result ) ); - var_dump($result); + var_dump(is_wp_error( $result )); die(); @unlink( __DIR__.'/blacklist_readable.txt' ); From e880aebd5fbd932d4adc87402ab051edec98ccaf Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 23:21:40 +0200 Subject: [PATCH 16/29] Revert back to original test --- tests/test-plugin.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test-plugin.php b/tests/test-plugin.php index f96582f..9343b38 100644 --- a/tests/test-plugin.php +++ b/tests/test-plugin.php @@ -82,8 +82,6 @@ public function test_file_readable_removed_default_blocked() { // Old entry ok $result = wp_remote_get('https://connect.advancedcustomfields.com'); $this->assertFalse( is_wp_error( $result ) ); - var_dump(is_wp_error( $result )); - die(); @unlink( __DIR__.'/blacklist_readable.txt' ); From ee6f5a00a4afdb7543f3a27bfc241f54f8e73cbd Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Wed, 27 May 2020 23:33:29 +0200 Subject: [PATCH 17/29] Simplify the actions --- .github/workflows/ci.yml | 5 ----- .github/workflows/quality.yml | 9 ++------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36e8e5e..33e8717 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,17 +29,12 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: mbstring, intl #optional, setup extensions - ini-values: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration coverage: xdebug #optional, setup coverage driver tools: phpunit:7.5.20 - name: Start mysql service run: sudo /etc/init.d/mysql start - - name: Check PHP Version - run: php -v - - name: Install WP Tests run: bash bin/install-wp-tests.sh wordpress_test root root localhost latest diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 67ee119..40b719c 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -22,17 +22,12 @@ jobs: ini-values: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration coverage: xdebug #optional, setup coverage driver tools: psalm, phpcbf, phpcs - - name: Check PHP Version - run: php -v - - - name: Add dependencies - run: composer install - name: Check composer run: composer validate - name: Check cs - run: composer cs + run: phpcs - name: Check psalm - run: composer psalm \ No newline at end of file + run: psalm \ No newline at end of file From a4a366e7774b0664305952b8f7e5eee65364f167 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Thu, 28 May 2020 09:55:55 +0200 Subject: [PATCH 18/29] Use the function directly, do not use wp_remote_get --- tests/test-plugin.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/test-plugin.php b/tests/test-plugin.php index 9343b38..d2bc55e 100644 --- a/tests/test-plugin.php +++ b/tests/test-plugin.php @@ -36,16 +36,16 @@ private function filter_file_unredable() { public function test_blacklisted() { // Replace this with some actual testing code. - $result = wp_remote_get('https://connect.advancedcustomfields.com'); + $result = BEAPI\WPHTTPBlacklist\pre_http_request(false, [], 'https://connect.advancedcustomfields.com'); $this->assertTrue( is_wp_error( $result ) ); } public function test_not_blacklisted() { // Replace this with some actual testing code. - $result = wp_remote_get('https://google.fr'); + $result = BEAPI\WPHTTPBlacklist\pre_http_request(false, [], 'https://google.fr'); - $this->assertFalse( is_wp_error( $result ) ); + $this->assertFalse( $result ); } public function test_filter() { @@ -54,7 +54,7 @@ public function test_filter() { return $blacklist; }); - $result = wp_remote_get('https://google.fr'); + $result = BEAPI\WPHTTPBlacklist\pre_http_request(false, [], 'https://google.fr'); $this->assertTrue( is_wp_error( $result ) ); @@ -64,12 +64,12 @@ public function test_file_readable() { $this->filter_file_redable(); // New entry with space ok - $result = wp_remote_get('https://google.fr'); + $result = BEAPI\WPHTTPBlacklist\pre_http_request(false, [], 'https://google.fr'); $this->assertTrue( is_wp_error( $result ) ); $this->assertEquals( $result->get_error_code(), 'http_request_blocked' ); // New entry with space ok - $result = wp_remote_get('https://beapi.fr'); + $result = BEAPI\WPHTTPBlacklist\pre_http_request(false, [], 'https://beapi.fr'); $this->assertTrue( is_wp_error( $result ) ); $this->assertEquals( $result->get_error_code(), 'http_request_blocked' ); @@ -80,19 +80,18 @@ public function test_file_readable_removed_default_blocked() { $this->filter_file_redable(); // Old entry ok - $result = wp_remote_get('https://connect.advancedcustomfields.com'); - $this->assertFalse( is_wp_error( $result ) ); + $result = BEAPI\WPHTTPBlacklist\pre_http_request(false, [], 'https://connect.advancedcustomfields.com'); + $this->assertFalse( $result ); @unlink( __DIR__.'/blacklist_readable.txt' ); - } public function test_file_unreadable() { $this->filter_file_unredable(); // New entry with space ok - $result = wp_remote_get('https://google.fr'); - $this->assertFalse( is_wp_error( $result ) ); + $result = BEAPI\WPHTTPBlacklist\pre_http_request(false, [], 'https://google.fr'); + $this->assertFalse( $result ); @unlink( __DIR__.'/blacklist_unreadable.txt' ); } From 238cdd480854aa10634cd8831613d909e7dbf410 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Thu, 28 May 2020 10:05:24 +0200 Subject: [PATCH 19/29] Use the composer dependencies since it autoloads the wordpress-coding-standards --- .github/workflows/quality.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 40b719c..9b9c5cd 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -7,6 +7,7 @@ jobs: runs-on: ${{ matrix.operating-system }} strategy: matrix: + fail-fast: false operating-system: [ ubuntu-latest ] php-versions: [ 7.4' ] name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} @@ -21,13 +22,15 @@ jobs: extensions: mbstring, intl #optional, setup extensions ini-values: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration coverage: xdebug #optional, setup coverage driver - tools: psalm, phpcbf, phpcs - name: Check composer run: composer validate + - name: Add dependencies + run: composer install + - name: Check cs - run: phpcs + run: composer cs - name: Check psalm - run: psalm \ No newline at end of file + run: composer psalm \ No newline at end of file From 4385322b7f331607346421e88af86213ad1ee78f Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Thu, 28 May 2020 17:34:10 +0200 Subject: [PATCH 20/29] Use constants for the file path --- tests/test-plugin.php | 75 +++++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/tests/test-plugin.php b/tests/test-plugin.php index d2bc55e..080cea0 100644 --- a/tests/test-plugin.php +++ b/tests/test-plugin.php @@ -8,53 +8,66 @@ /** * Basic plugin tests. */ -class WP_HTTP_BLACKLIST extends WP_UnitTestCase { +class WP_HTTP_BLACKLIST_TEST extends WP_UnitTestCase { + + const READABLE_FILE = __DIR__ . '/blacklist_readable.txt'; + const UNREADABLE_FILE = __DIR__ . '/blacklist_unreadable.txt'; + + /** + * Create a readable file with domains to block + */ private function filter_file_redable() { - add_filter('wp_http_blacklist_file', function() { - @unlink( __DIR__.'/blacklist_readable.txt' ); - file_put_contents( __DIR__.'/blacklist_readable.txt', - 'google.fr + @unlink( self::READABLE_FILE ); + file_put_contents( self::READABLE_FILE, + 'google.fr beapi.fr - ' - ); - return __DIR__.'/blacklist_readable.txt'; - }); + ' + ); + + add_filter( 'wp_http_blacklist_file', function () { + return self::READABLE_FILE; + } ); } + /** + * + */ private function filter_file_unredable() { - add_filter('wp_http_blacklist_file', function() { - @unlink( __DIR__.'/blacklist_unreadable.txt' ); - file_put_contents( __DIR__.'/blacklist_unreadable.txt', - 'google.fr + @unlink( self::UNREADABLE_FILE ); + file_put_contents( self::UNREADABLE_FILE, + 'google.fr beapi.fr - ' - ); - chmod( __DIR__.'/blacklist_unreadable.txt', 0377 ); - return __DIR__.'/blacklist_unreadable.txt'; - }); - } + ' + ); + chmod( self::UNREADABLE_FILE, 0377 ); + + add_filter( 'wp_http_blacklist_file', function () { + return self::UNREADABLE_FILE; + } ); + } public function test_blacklisted() { // Replace this with some actual testing code. - $result = BEAPI\WPHTTPBlacklist\pre_http_request(false, [], 'https://connect.advancedcustomfields.com'); + $result = BEAPI\WPHTTPBlacklist\pre_http_request( false, [], 'https://connect.advancedcustomfields.com' ); $this->assertTrue( is_wp_error( $result ) ); } public function test_not_blacklisted() { // Replace this with some actual testing code. - $result = BEAPI\WPHTTPBlacklist\pre_http_request(false, [], 'https://google.fr'); + $result = BEAPI\WPHTTPBlacklist\pre_http_request( false, [], 'https://google.fr' ); $this->assertFalse( $result ); } public function test_filter() { - add_filter('wp_http_blacklist', function( $blacklist ) { + add_filter( 'wp_http_blacklist', function ( $blacklist ) { $blacklist[] = 'google.fr'; + return $blacklist; - }); + } ); - $result = BEAPI\WPHTTPBlacklist\pre_http_request(false, [], 'https://google.fr'); + $result = BEAPI\WPHTTPBlacklist\pre_http_request( false, [], 'https://google.fr' ); $this->assertTrue( is_wp_error( $result ) ); @@ -64,35 +77,35 @@ public function test_file_readable() { $this->filter_file_redable(); // New entry with space ok - $result = BEAPI\WPHTTPBlacklist\pre_http_request(false, [], 'https://google.fr'); + $result = BEAPI\WPHTTPBlacklist\pre_http_request( false, [], 'https://google.fr' ); $this->assertTrue( is_wp_error( $result ) ); $this->assertEquals( $result->get_error_code(), 'http_request_blocked' ); // New entry with space ok - $result = BEAPI\WPHTTPBlacklist\pre_http_request(false, [], 'https://beapi.fr'); + $result = BEAPI\WPHTTPBlacklist\pre_http_request( false, [], 'https://beapi.fr' ); $this->assertTrue( is_wp_error( $result ) ); $this->assertEquals( $result->get_error_code(), 'http_request_blocked' ); - @unlink( __DIR__.'/blacklist_readable.txt' ); + @unlink( __DIR__ . '/blacklist_readable.txt' ); } public function test_file_readable_removed_default_blocked() { $this->filter_file_redable(); // Old entry ok - $result = BEAPI\WPHTTPBlacklist\pre_http_request(false, [], 'https://connect.advancedcustomfields.com'); + $result = BEAPI\WPHTTPBlacklist\pre_http_request( false, [], 'https://connect.advancedcustomfields.com' ); $this->assertFalse( $result ); - @unlink( __DIR__.'/blacklist_readable.txt' ); + @unlink( __DIR__ . '/blacklist_readable.txt' ); } public function test_file_unreadable() { $this->filter_file_unredable(); // New entry with space ok - $result = BEAPI\WPHTTPBlacklist\pre_http_request(false, [], 'https://google.fr'); + $result = BEAPI\WPHTTPBlacklist\pre_http_request( false, [], 'https://google.fr' ); $this->assertFalse( $result ); - @unlink( __DIR__.'/blacklist_unreadable.txt' ); + @unlink( __DIR__ . '/blacklist_unreadable.txt' ); } } From 5ef9684645418884f2c8b1a3d85cac7bc9d9c891 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Thu, 28 May 2020 18:06:45 +0200 Subject: [PATCH 21/29] Add the tests documentation --- TESTS.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 TESTS.md diff --git a/TESTS.md b/TESTS.md new file mode 100644 index 0000000..1aadf3d --- /dev/null +++ b/TESTS.md @@ -0,0 +1,32 @@ +# Installation + +For this you need : +- A local mysql server +- A PHP interpreter +- Composer installed + +You need to do : + +``` +composer install +composer install-tests +``` + +Assuming you have the user root with no password. +This will download the latest version of WordPress available. +Other arguments allows you to download other versions of WordPress, read the `bin/install-wp-tests.sh` for more informations :) + +# Launching tests + +Since we moved the WordPress tests library to another location, you will need specify the folder. +There is a composer script for this : + +``` +composer test +``` + +# Known caveats + +You cannot read tests from PHPStorm method by method because of the way they are handled. +You need to specify the WP_TESTS_DIR env variable by hand for each method after fail. +I recommend to launch all the tests every time. \ No newline at end of file From b5fd2c604e1edfa48f287785183b5e4887834920 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Thu, 28 May 2020 18:07:28 +0200 Subject: [PATCH 22/29] Add phpunit on dev deps, add scripts for launching tests and instaling them --- composer.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 2d4ac40..e1a8e94 100644 --- a/composer.json +++ b/composer.json @@ -24,11 +24,14 @@ "vimeo/psalm": "^3.11", "wp-coding-standards/wpcs": "^2.2", "overtrue/phplint": "^2.0", - "php-parallel-lint/php-parallel-lint": "^1.2" + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpunit/phpunit": "7.*" }, "scripts": { "cs": "./vendor/bin/phpcs", "cbf": "./vendor/bin/phpcbf", - "psalm": "./vendor/bin/psalm" + "psalm": "./vendor/bin/psalm", + "install-tests" : "TMPDIR=./bin/tests-framework/ ./bin/install-wp-tests.sh tests root ''", + "tests": "./vendor/bin/phpunit --colors=always" } } From 83cac96169818ba39f6bdf30152447e29149cebd Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Thu, 28 May 2020 18:07:39 +0200 Subject: [PATCH 23/29] commit lock --- composer.lock | 1441 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 1302 insertions(+), 139 deletions(-) diff --git a/composer.lock b/composer.lock index 50397bf..7fb93a4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5651285542068ba2fd52f1b652fd0395", + "content-hash": "b8f235bf59b73708e25885822892403b", "packages": [ { "name": "composer/installers", @@ -465,6 +465,62 @@ ], "time": "2020-01-29T20:22:20+00:00" }, + { + "name": "doctrine/instantiator", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2019-10-21T16:45:58+00:00" + }, { "name": "felixfbecker/advanced-json-rpc", "version": "v3.1.1", @@ -553,6 +609,54 @@ ], "time": "2019-06-23T21:03:50+00:00" }, + { + "name": "myclabs/deep-copy", + "version": "1.9.5", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2020-01-17T21:11:47+00:00" + }, { "name": "n98/junit-xml", "version": "1.0.0", @@ -853,6 +957,108 @@ ], "time": "2020-04-23T02:04:34+00:00" }, + { + "name": "phar-io/manifest", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^2.0", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2018-07-08T19:23:20+00:00" + }, + { + "name": "phar-io/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2018-07-08T19:19:57+00:00" + }, { "name": "php-parallel-lint/php-parallel-lint", "version": "v1.2.0", @@ -1114,20 +1320,20 @@ }, { "name": "phpro/grumphp-shim", - "version": "v0.18.0", + "version": "v0.18.1", "source": { "type": "git", "url": "https://github.com/phpro/grumphp-shim.git", - "reference": "81a84da47cc825c208b4664857977fbfbf71f0f6" + "reference": "c00e9577225c70eaa0d2b431efad4ea6ae420d9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpro/grumphp-shim/zipball/81a84da47cc825c208b4664857977fbfbf71f0f6", - "reference": "81a84da47cc825c208b4664857977fbfbf71f0f6", + "url": "https://api.github.com/repos/phpro/grumphp-shim/zipball/c00e9577225c70eaa0d2b431efad4ea6ae420d9f", + "reference": "c00e9577225c70eaa0d2b431efad4ea6ae420d9f", "shasum": "" }, "require": { - "composer-plugin-api": "~1.0", + "composer-plugin-api": "~1.0 || ~2.0", "ext-json": "*", "php": "^7.1" }, @@ -1135,7 +1341,8 @@ "phpro/grumphp": "self.version" }, "require-dev": { - "humbug/box": "^3.8" + "humbug/box": "^3.8.4", + "jetbrains/phpstorm-stubs": "dev-master@dev" }, "bin": [ "grumphp", @@ -1165,34 +1372,42 @@ } ], "description": "GrumPHP Phar distribution", - "time": "2020-02-25T18:05:09+00:00" + "time": "2020-05-27T04:55:37+00:00" }, { - "name": "psr/container", - "version": "1.0.0", + "name": "phpspec/prophecy", + "version": "v1.10.3", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "url": "https://github.com/phpspec/prophecy.git", + "reference": "451c3cd1418cf640de218914901e51b064abb093" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", "shasum": "" }, "require": { - "php": ">=5.3.0" + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5 || ^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -1201,108 +1416,499 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14T16:28:37+00:00" + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2020-03-05T15:02:03+00:00" }, { - "name": "psr/log", - "version": "1.1.3", + "name": "phpunit/php-code-coverage", + "version": "6.1.4", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", "shasum": "" }, "require": { - "php": ">=5.3.0" + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.1", + "phpunit/php-file-iterator": "^2.0", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^3.0", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.1 || ^4.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "suggest": { + "ext-xdebug": "^2.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "6.1-dev" } }, "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2018-10-31T16:06:48+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "050bedf145a257b1ff02746c31894800e5122946" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", "keywords": [ - "log", - "psr", - "psr-3" + "filesystem", + "iterator" ], - "time": "2020-03-23T09:12:05+00:00" + "time": "2018-09-13T20:33:42+00:00" }, { - "name": "roave/security-advisories", - "version": "dev-master", + "name": "phpunit/php-text-template", + "version": "1.2.1", "source": { "type": "git", - "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "e38de1df609b39d97144514d28b0804ad4daaddb" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/e38de1df609b39d97144514d28b0804ad4daaddb", - "reference": "e38de1df609b39d97144514d28b0804ad4daaddb", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "shasum": "" }, - "conflict": { - "3f/pygmentize": "<1.2", - "adodb/adodb-php": "<5.20.12", - "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", - "amphp/artax": "<1.0.6|>=2,<2.0.6", - "amphp/http": "<1.0.1", - "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6", - "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", - "aws/aws-sdk-php": ">=3,<3.2.1", - "bagisto/bagisto": "<0.1.5", - "barrelstrength/sprout-base-email": "<1.2.7", - "barrelstrength/sprout-forms": "<3.9", - "bolt/bolt": "<3.6.10", - "brightlocal/phpwhois": "<=4.2.5", - "buddypress/buddypress": "<5.1.2", - "bugsnag/bugsnag-laravel": ">=2,<2.0.2", - "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.5.18|>=3.6,<3.6.15|>=3.7,<3.7.7", - "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", - "cartalyst/sentry": "<=2.1.6", - "centreon/centreon": "<18.10.8|>=19,<19.4.5", - "cesnet/simplesamlphp-module-proxystatistics": "<3.1", - "codeigniter/framework": "<=3.0.6", - "composer/composer": "<=1-alpha.11", - "contao-components/mediaelement": ">=2.14.2,<2.21.1", - "contao/core": ">=2,<3.5.39", - "contao/core-bundle": ">=4,<4.4.46|>=4.5,<4.8.6", + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2019-06-07T04:22:29+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2019-09-17T06:23:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "7.5.20", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "9467db479d1b0487c99733bb1e7944d32deded2c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9467db479d1b0487c99733bb1e7944d32deded2c", + "reference": "9467db479d1b0487c99733bb1e7944d32deded2c", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.2", + "phar-io/version": "^2.0", + "php": "^7.1", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^2.1", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", + "sebastian/environment": "^4.0", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^2.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpunit/phpunit-mock-objects": "*" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*", + "phpunit/php-invoker": "^2.0" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2020-01-08T08:45:45+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/log", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2020-03-23T09:12:05+00:00" + }, + { + "name": "roave/security-advisories", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/Roave/SecurityAdvisories.git", + "reference": "55922f51129488c246a776ff944463605d447da0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/55922f51129488c246a776ff944463605d447da0", + "reference": "55922f51129488c246a776ff944463605d447da0", + "shasum": "" + }, + "conflict": { + "3f/pygmentize": "<1.2", + "adodb/adodb-php": "<5.20.12", + "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", + "amphp/artax": "<1.0.6|>=2,<2.0.6", + "amphp/http": "<1.0.1", + "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6", + "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", + "aws/aws-sdk-php": ">=3,<3.2.1", + "bagisto/bagisto": "<0.1.5", + "barrelstrength/sprout-base-email": "<1.2.7", + "barrelstrength/sprout-forms": "<3.9", + "bolt/bolt": "<3.6.10", + "brightlocal/phpwhois": "<=4.2.5", + "buddypress/buddypress": "<5.1.2", + "bugsnag/bugsnag-laravel": ">=2,<2.0.2", + "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.5.18|>=3.6,<3.6.15|>=3.7,<3.7.7", + "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", + "cartalyst/sentry": "<=2.1.6", + "centreon/centreon": "<18.10.8|>=19,<19.4.5", + "cesnet/simplesamlphp-module-proxystatistics": "<3.1", + "codeigniter/framework": "<=3.0.6", + "composer/composer": "<=1-alpha.11", + "contao-components/mediaelement": ">=2.14.2,<2.21.1", + "contao/core": ">=2,<3.5.39", + "contao/core-bundle": ">=4,<4.4.46|>=4.5,<4.8.6", "contao/listing-bundle": ">=4,<4.4.8", "datadog/dd-trace": ">=0.30,<0.30.2", "david-garcia/phpwhois": "<=4.3.1", @@ -1378,7 +1984,7 @@ "paypal/merchant-sdk-php": "<3.12", "pear/archive_tar": "<1.4.4", "phpfastcache/phpfastcache": ">=5,<5.0.13", - "phpmailer/phpmailer": ">=5,<5.2.27|>=6,<6.0.6", + "phpmailer/phpmailer": "<6.1.6", "phpmyadmin/phpmyadmin": "<4.9.2", "phpoffice/phpexcel": "<1.8.2", "phpoffice/phpspreadsheet": "<1.8", @@ -1513,61 +2119,488 @@ "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", "zfr/zfr-oauth2-server-module": "<0.1.2" }, - "type": "metapackage", + "type": "metapackage", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "role": "maintainer" + }, + { + "name": "Ilya Tribusean", + "email": "slash3b@gmail.com", + "role": "maintainer" + } + ], + "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", + "funding": [ + { + "url": "https://github.com/Ocramius", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/roave/security-advisories", + "type": "tidelift" + } + ], + "time": "2020-05-28T00:01:39+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "shasum": "" + }, + "require": { + "php": "^7.1", + "sebastian/diff": "^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-07-12T15:12:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "time": "2019-02-04T06:01:07+00:00" + }, + { + "name": "sebastian/environment", + "version": "4.2.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2019-11-20T08:46:58+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "role": "maintainer" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" }, { - "name": "Ilya Tribusean", - "email": "slash3b@gmail.com", - "role": "maintainer" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "funding": [ + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2019-09-14T09:02:43+00:00" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ { - "url": "https://github.com/Ocramius", - "type": "github" - }, + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ { - "url": "https://tidelift.com/funding/github/packagist/roave/security-advisories", - "type": "tidelift" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "time": "2020-05-22T06:49:22+00:00" + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" }, { - "name": "sebastian/diff", - "version": "4.0.1", + "name": "sebastian/object-reflector", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3e523c576f29dacecff309f35e4cc5a5c168e78a" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3e523c576f29dacecff309f35e4cc5a5c168e78a", - "reference": "3e523c576f29dacecff309f35e4cc5a5c168e78a", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", "shasum": "" }, "require": { - "php": "^7.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^9.0", - "symfony/process": "^4.2 || ^5" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1580,30 +2613,107 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" ], - "funding": [ + "authors": [ { - "url": "https://github.com/sebastianbergmann", - "type": "github" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2018-10-04T04:07:39+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "time": "2020-05-08T05:01:12+00:00" + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" }, { "name": "sensiolabs/security-checker", @@ -1941,20 +3051,20 @@ }, { "name": "symfony/http-client-contracts", - "version": "v2.1.1", + "version": "v2.1.2", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "e3ba2688594d8ef284f40348f7efb72cba4edec4" + "reference": "f8bed25edc964d015bcd87f1fec5734963931910" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/e3ba2688594d8ef284f40348f7efb72cba4edec4", - "reference": "e3ba2688594d8ef284f40348f7efb72cba4edec4", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/f8bed25edc964d015bcd87f1fec5734963931910", + "reference": "f8bed25edc964d015bcd87f1fec5734963931910", "shasum": "" }, "require": { - "php": "^7.2.5" + "php": ">=7.2.5" }, "suggest": { "symfony/http-client-implementation": "" @@ -2008,7 +3118,7 @@ "type": "tidelift" } ], - "time": "2020-05-09T18:37:03+00:00" + "time": "2020-05-25T17:37:45+00:00" }, { "name": "symfony/mime", @@ -2513,20 +3623,20 @@ }, { "name": "symfony/service-contracts", - "version": "v2.0.1", + "version": "v2.1.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "144c5e51266b281231e947b51223ba14acf1a749" + "reference": "66a8f0957a3ca54e4f724e49028ab19d75a8918b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", - "reference": "144c5e51266b281231e947b51223ba14acf1a749", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/66a8f0957a3ca54e4f724e49028ab19d75a8918b", + "reference": "66a8f0957a3ca54e4f724e49028ab19d75a8918b", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "psr/container": "^1.0" }, "suggest": { @@ -2535,7 +3645,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.1-dev" } }, "autoload": { @@ -2567,7 +3677,21 @@ "interoperability", "standards" ], - "time": "2019-11-18T17:27:11+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-05-20T17:43:50+00:00" }, { "name": "symfony/yaml", @@ -2642,18 +3766,58 @@ ], "time": "2020-04-28T17:58:55+00:00" }, + { + "name": "theseer/tokenizer", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2019-06-13T22:48:21+00:00" + }, { "name": "vimeo/psalm", - "version": "3.11.4", + "version": "3.11.5", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "58e1d8e68e5098bf4fbfdfb420c38d563f882549" + "reference": "3c60609c218d4d4b3b257728b8089094e5c6c6c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/58e1d8e68e5098bf4fbfdfb420c38d563f882549", - "reference": "58e1d8e68e5098bf4fbfdfb420c38d563f882549", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/3c60609c218d4d4b3b257728b8089094e5c6c6c2", + "reference": "3c60609c218d4d4b3b257728b8089094e5c6c6c2", "shasum": "" }, "require": { @@ -2715,8 +3879,7 @@ }, "autoload": { "psr-4": { - "Psalm\\Plugin\\": "src/Psalm/Plugin", - "Psalm\\": "src/Psalm" + "Psalm\\": "src/Psalm/" }, "files": [ "src/functions.php", @@ -2738,7 +3901,7 @@ "inspection", "php" ], - "time": "2020-05-11T13:39:25+00:00" + "time": "2020-05-27T15:12:09+00:00" }, { "name": "webmozart/assert", From 2e93720082f7eec1777384a6a167a1c0f7666995 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Thu, 28 May 2020 18:08:06 +0200 Subject: [PATCH 24/29] Ignore tests folders, add env vriable for wp-tests-folder --- .gitignore | 2 ++ phpunit.xml.dist | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index f4c39fb..492498d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ # Tests /tests/*.txt + +/bin/tests-framework/ \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 09458d9..328aeb0 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -12,4 +12,7 @@ ./tests/ + + + From 482c00c31d6e7beceb10aa052c86dcc17dadb1eb Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Thu, 28 May 2020 18:08:53 +0200 Subject: [PATCH 25/29] Adapt the tests in the ci for using composer command --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33e8717..ef86a15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,9 @@ jobs: run: sudo /etc/init.d/mysql start - name: Install WP Tests + env: + TMPDIR: bin/tests-framework/ run: bash bin/install-wp-tests.sh wordpress_test root root localhost latest - name: phpunit tests - run: phpunit \ No newline at end of file + run: composer tests \ No newline at end of file From 99e7ce3eb4c71960f2ec7e466755dfd430182b02 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Thu, 28 May 2020 18:10:49 +0200 Subject: [PATCH 26/29] fix fail-fast position --- .github/workflows/quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 9b9c5cd..e85c5f9 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -6,8 +6,8 @@ jobs: run: runs-on: ${{ matrix.operating-system }} strategy: + fail-fast: false matrix: - fail-fast: false operating-system: [ ubuntu-latest ] php-versions: [ 7.4' ] name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} From 2d1229959febc08602ef8f8257443e1fb817cd4e Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Thu, 28 May 2020 18:11:58 +0200 Subject: [PATCH 27/29] Compile dependencies --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef86a15..8f771ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,11 +30,13 @@ jobs: with: php-version: ${{ matrix.php-versions }} coverage: xdebug #optional, setup coverage driver - tools: phpunit:7.5.20 - + - name: Start mysql service run: sudo /etc/init.d/mysql start + - name: Add dependencies + run: composer install + - name: Install WP Tests env: TMPDIR: bin/tests-framework/ From c18e8bf43d27917c37dd113409ba5e7d6b6bd96c Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Thu, 28 May 2020 18:14:45 +0200 Subject: [PATCH 28/29] Restore the phpunit module from image --- .github/workflows/ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f771ab..5f38676 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,17 +30,15 @@ jobs: with: php-version: ${{ matrix.php-versions }} coverage: xdebug #optional, setup coverage driver - + tools: phpunit:7.5.20 + - name: Start mysql service run: sudo /etc/init.d/mysql start - - name: Add dependencies - run: composer install - - name: Install WP Tests env: - TMPDIR: bin/tests-framework/ + TMPDIR: ./bin/tests-framework/ run: bash bin/install-wp-tests.sh wordpress_test root root localhost latest - name: phpunit tests - run: composer tests \ No newline at end of file + run: phpunit \ No newline at end of file From a38476b6863daa77b17b4830db5bdc9f38cc36b5 Mon Sep 17 00:00:00 2001 From: Nicolas Juen Date: Thu, 28 May 2020 18:27:48 +0200 Subject: [PATCH 29/29] Only make tests in PHP7.4 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f38676..3bdc835 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: operating-system: [ ubuntu-latest ] - php-versions: [ '7.1', '7.2', '7.3', '7.4' ] + php-versions: [ '7.4' ] name: PHP ${{ matrix.php-versions }} steps: - name: Checkout