From 5e6a5c216055c3d9a1e962a8657d7522e91fe5c4 Mon Sep 17 00:00:00 2001 From: Patrick Henninger Date: Thu, 10 Sep 2020 00:48:11 +0200 Subject: [PATCH 1/7] Update dependencies for laravel 8 compatibility, Remove scruntinizer in favor of codecov, --- .scrutinizer.yml | 23 ----------------------- .travis.yml | 4 ++-- composer.json | 33 ++++++++++++++++----------------- 3 files changed, 18 insertions(+), 42 deletions(-) delete mode 100644 .scrutinizer.yml diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index e0425f1..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,23 +0,0 @@ -filter: - excluded_paths: [tests/*] - -checks: - php: - remove_extra_empty_lines: true - remove_php_closing_tag: true - remove_trailing_whitespace: true - fix_use_statements: - remove_unused: true - preserve_multiple: false - preserve_blanklines: true - order_alphabetically: true - fix_php_opening_tag: true - fix_linefeed: true - fix_line_ending: true - fix_identation_4spaces: true - fix_doc_comments: true - -tools: - external_code_coverage: - timeout: 600 - runs: 3 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 105169b..aed6062 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ before_script: - travis_retry composer install --prefer-source --no-interaction --dev script: - - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover + - vendor/bin/phpunit --coverage-clover=coverage.xml after_script: - - php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover + - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/composer.json b/composer.json index 974572c..1a8afa3 100755 --- a/composer.json +++ b/composer.json @@ -15,16 +15,15 @@ ], "require": { "php": "^7.2", - "illuminate/config": "^5.1|^6.0|^7.0", - "illuminate/support": "^5.1|^6.0|^7.0", - "illuminate/filesystem": "^5.1|^6.0|^7.0", + "illuminate/config": "^5.1|^6.0|^7.0|^8.0", + "illuminate/support": "^5.1|^6.0|^7.0|^8.0", + "illuminate/filesystem": "^5.1|^6.0|^7.0|^8.0", "ezyang/htmlpurifier": "4.13.*" }, "require-dev": { - "phpunit/phpunit": "^4.8|^5.0", - "mockery/mockery": "0.9.*", - "graham-campbell/testbench": "^3.2", - "scrutinizer/ocular": "^1.3" + "phpunit/phpunit": "4.8|^5.0|^8.3|^9.0", + "mockery/mockery": "0.9.*|^1.0", + "graham-campbell/testbench": "^3.2|^5.5.1" }, "suggest": { "laravel/framework": "To test the Laravel bindings", @@ -43,16 +42,16 @@ "Mews\\Tests\\Purifier\\": "tests/" } }, - "extra": { - "laravel": { - "providers": [ - "Mews\\Purifier\\PurifierServiceProvider" - ], - "aliases": { - "Purifier": "Mews\\Purifier\\Facades\\Purifier" - } - } - }, + "extra": { + "laravel": { + "providers": [ + "Mews\\Purifier\\PurifierServiceProvider" + ], + "aliases": { + "Purifier": "Mews\\Purifier\\Facades\\Purifier" + } + } + }, "minimum-stability": "dev", "prefer-stable": true } From ca25de0c33b4c3773806db1bae5028a74c5ea9db Mon Sep 17 00:00:00 2001 From: Patrick Date: Thu, 10 Sep 2020 00:52:15 +0200 Subject: [PATCH 2/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b869698..98e9ee2 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# HTMLPurifier for Laravel 5/6/7 +# HTMLPurifier for Laravel 5/6/7/8 [![Build Status](https://scrutinizer-ci.com/g/mewebstudio/Purifier/badges/build.png?b=master)](https://scrutinizer-ci.com/g/mewebstudio/Purifier/build-status/master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mewebstudio/Purifier/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mewebstudio/Purifier/?branch=master) [![Latest Stable Version](https://poser.pugx.org/mews/Purifier/v/stable.svg)](https://packagist.org/packages/mews/Purifier) From c2142765e2c4717a6de793e920021885f0c1d16c Mon Sep 17 00:00:00 2001 From: Patrick Henninger Date: Thu, 10 Sep 2020 00:56:13 +0200 Subject: [PATCH 3/7] Add codecov to readme, Remove scruntinizer from readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 98e9ee2..4614f24 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # HTMLPurifier for Laravel 5/6/7/8 -[![Build Status](https://scrutinizer-ci.com/g/mewebstudio/Purifier/badges/build.png?b=master)](https://scrutinizer-ci.com/g/mewebstudio/Purifier/build-status/master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mewebstudio/Purifier/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mewebstudio/Purifier/?branch=master) +[![Build Status](https://scrutinizer-ci.com/g/mewebstudio/Purifier/badges/build.png?b=master)](https://scrutinizer-ci.com/g/mewebstudio/Purifier/build-status/master) [![codecov](https://codecov.io/gh/mewebstudio/Purifier/branch/master/graph/badge.svg)](https://codecov.io/gh/mewebstudio/Purifier) [![Latest Stable Version](https://poser.pugx.org/mews/Purifier/v/stable.svg)](https://packagist.org/packages/mews/Purifier) [![Latest Unstable Version](https://poser.pugx.org/mews/Purifier/v/unstable.svg)](https://packagist.org/packages/mews/Purifier) [![License](https://poser.pugx.org/mews/Purifier/license.svg)](https://packagist.org/packages/mews/Purifier) From 0a8cce0075d69bd685e61a70644c0971d0981a54 Mon Sep 17 00:00:00 2001 From: Patrick Henninger Date: Thu, 10 Sep 2020 00:58:43 +0200 Subject: [PATCH 4/7] Use travis build status, Add newline, --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4614f24..a99a109 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # HTMLPurifier for Laravel 5/6/7/8 -[![Build Status](https://scrutinizer-ci.com/g/mewebstudio/Purifier/badges/build.png?b=master)](https://scrutinizer-ci.com/g/mewebstudio/Purifier/build-status/master) [![codecov](https://codecov.io/gh/mewebstudio/Purifier/branch/master/graph/badge.svg)](https://codecov.io/gh/mewebstudio/Purifier) +[![Build Status](https://travis-ci.org/mewebstudio/Purifier.svg?branch=master)](https://travis-ci.org/github/mewebstudio/Purifier) +[![codecov](https://codecov.io/gh/mewebstudio/Purifier/branch/master/graph/badge.svg)](https://codecov.io/gh/mewebstudio/Purifier) [![Latest Stable Version](https://poser.pugx.org/mews/Purifier/v/stable.svg)](https://packagist.org/packages/mews/Purifier) [![Latest Unstable Version](https://poser.pugx.org/mews/Purifier/v/unstable.svg)](https://packagist.org/packages/mews/Purifier) [![License](https://poser.pugx.org/mews/Purifier/license.svg)](https://packagist.org/packages/mews/Purifier) From 8f3290f1465da18d97a0252469763755c71504df Mon Sep 17 00:00:00 2001 From: Patrick Henninger Date: Thu, 10 Sep 2020 01:20:27 +0200 Subject: [PATCH 5/7] Fix test --- tests/PurifierTest.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/PurifierTest.php b/tests/PurifierTest.php index e335bb3..378385d 100644 --- a/tests/PurifierTest.php +++ b/tests/PurifierTest.php @@ -10,7 +10,7 @@ class PurifierTest extends AbstractTestCase { - public function setUp() + public function setUp() : void { parent::setUp(); @@ -24,19 +24,14 @@ public function testConstruct() { $purifier = $this->app->make('purifier'); $this->assertInstanceOf(Purifier::class, $purifier); - $this->assertAttributeInstanceOf(HTMLPurifier::class, 'purifier', $purifier); + $this->assertInstanceOf(HTMLPurifier::class, $purifier->getInstance()); } - /** - * @expectedException \Exception - * @expectedExceptionMessage Configuration parameters not loaded! - */ - /** - * @expectedException \Exception - * @expectedExceptionMessage Configuration parameters not loaded! - */ public function testExpectionIsThrownWhenConfigIsBad() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('Configuration parameters not loaded!'); + new Purifier(new Filesystem(), new Repository()); } From 5dbf9f6a6e9a4e5b6d609ce6d3bf98d62ec14c0f Mon Sep 17 00:00:00 2001 From: Patrick Henninger Date: Thu, 10 Sep 2020 21:47:23 +0200 Subject: [PATCH 6/7] Fix composer install memory issue with travis, Add .phpunit.result.cache to .gitignore, Fix version constraint for PHPUnit, --- .gitignore | 3 +++ .travis.yml | 2 +- composer.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 62c5f7b..98bd9c2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ Vagrantfile Homestead.yaml after.sh aliases + +# Tests +.phpunit.result.cache \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index aed6062..6fadd0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ cache: before_script: - travis_retry composer self-update - - travis_retry composer install --prefer-source --no-interaction --dev + - COMPOSER_MEMORY_LIMIT=-1 travis_retry composer install --prefer-source --no-interaction --dev script: - vendor/bin/phpunit --coverage-clover=coverage.xml diff --git a/composer.json b/composer.json index 1a8afa3..e6dfa81 100755 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "ezyang/htmlpurifier": "4.13.*" }, "require-dev": { - "phpunit/phpunit": "4.8|^5.0|^8.3|^9.0", + "phpunit/phpunit": "^4.8|^5.0|^8.3|^9.0", "mockery/mockery": "0.9.*|^1.0", "graham-campbell/testbench": "^3.2|^5.5.1" }, From bc45b255f39ee4cbe0f9ed4f8762f6cbcc2df78e Mon Sep 17 00:00:00 2001 From: Patrick Henninger Date: Thu, 10 Sep 2020 21:55:46 +0200 Subject: [PATCH 7/7] Drop support for PHPunit < 8 / Laravel < 5.8, --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index e6dfa81..307509f 100755 --- a/composer.json +++ b/composer.json @@ -15,14 +15,14 @@ ], "require": { "php": "^7.2", - "illuminate/config": "^5.1|^6.0|^7.0|^8.0", - "illuminate/support": "^5.1|^6.0|^7.0|^8.0", - "illuminate/filesystem": "^5.1|^6.0|^7.0|^8.0", + "illuminate/config": "^5.8|^6.0|^7.0|^8.0", + "illuminate/support": "^5.8|^6.0|^7.0|^8.0", + "illuminate/filesystem": "^5.8|^6.0|^7.0|^8.0", "ezyang/htmlpurifier": "4.13.*" }, "require-dev": { - "phpunit/phpunit": "^4.8|^5.0|^8.3|^9.0", - "mockery/mockery": "0.9.*|^1.0", + "phpunit/phpunit": "^8.0|^9.0", + "mockery/mockery": "^1.0", "graham-campbell/testbench": "^3.2|^5.5.1" }, "suggest": {