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/.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..6fadd0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,10 +15,10 @@ 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-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/README.md b/README.md index b869698..a99a109 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ -# 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) +[![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) diff --git a/composer.json b/composer.json index 974572c..307509f 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.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", - "mockery/mockery": "0.9.*", - "graham-campbell/testbench": "^3.2", - "scrutinizer/ocular": "^1.3" + "phpunit/phpunit": "^8.0|^9.0", + "mockery/mockery": "^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 } 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()); }