diff --git a/.gitignore b/.gitignore index 8ab9a62..eced6b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /vendor composer.lock src/config.php +.DS_Store diff --git a/.travis.yml b/.travis.yml index cfae540..429f95e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,22 +4,38 @@ sudo: false before_script: - travis_retry composer self-update - - travis_retry composer require "illuminate/support:${ILLUMINATE_VERSION}" + - travis_retry composer require "illuminate/support:${ILLUMINATE_VERSION}" "phpunit/phpunit:${PHPUNIT_VERSION}" script: - - phpunit + - composer test matrix: include: - php: 7.0 - env: ILLUMINATE_VERSION=5.4.* + env: + - ILLUMINATE_VERSION=5.4.* + - PHPUNIT_VERSION=~5.7 - php: 7.1 - env: ILLUMINATE_VERSION=5.5.* + env: + - ILLUMINATE_VERSION=5.5.* + - PHPUNIT_VERSION=~6.0 - php: 7.1 - env: ILLUMINATE_VERSION=5.6.* + env: + - ILLUMINATE_VERSION=5.6.* + - PHPUNIT_VERSION=7.1 - php: 7.2 - env: ILLUMINATE_VERSION=5.6.* + env: + - ILLUMINATE_VERSION=5.6.* + - PHPUNIT_VERSION=7.1 - php: 7.2 - env: ILLUMINATE_VERSION=5.7.* - - php: nightly - env: ILLUMINATE_VERSION=5.7.* + env: + - ILLUMINATE_VERSION=5.7.* + - PHPUNIT_VERSION=7.1 + - php: 7.2 + env: + - ILLUMINATE_VERSION=5.8.* + - PHPUNIT_VERSION=~7.5 + - php: 7.3 + env: + - ILLUMINATE_VERSION=5.8.* + - PHPUNIT_VERSION=~7.5 diff --git a/README.jp.md b/README.jp.md index fa0eb98..6132d71 100644 --- a/README.jp.md +++ b/README.jp.md @@ -31,7 +31,7 @@ Laravel | l5-very-basic-auth :--------------------------------------|:---------- `5.1.*/5.2.*` | `1.*` `5.3.*` | `2.*` -`5.4.*`/`5.5.*`/`5.6.*/5.7.*` | `5.*` +`^5.4` | `5.*` #### Laravel4.xを使っている場合 diff --git a/README.md b/README.md index 4c3c258..3bc5fcc 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Laravel | l5-very-basic-auth :--------------------------------------|:---------- `5.1.*/5.2.*` | `1.*` `5.3.*` | `2.*` -`5.4.*`/`5.5.*`/`5.6.*/5.7.*` | `5.*` +`^5.4` | `5.*` *The odd versioning is due to breaking changes in the testing framework and PHP versions. Else, `3.x` is usable for Laravel 5.4 (PHP 5.6 and up) and `4.x` for Laravel 5.5.* diff --git a/composer.json b/composer.json index 0ad3b4c..996f6a9 100644 --- a/composer.json +++ b/composer.json @@ -17,11 +17,11 @@ } ], "require": { - "illuminate/support": ">=5.4.0", + "illuminate/support": ">=5.4", "php" : "^7.0" }, "require-dev": { - "phpunit/phpunit": "^6.5 || 7.1", + "phpunit/phpunit": "^6.5 || ^7.5", "orchestra/testbench": ">=3.4.0" }, "autoload": { @@ -31,7 +31,7 @@ }, "autoload-dev": { "psr-4": { - "Olssonm\\VeryBasicAuth\\Test\\": "tests" + "Olssonm\\VeryBasicAuth\\Tests\\": "tests" } }, "scripts": { diff --git a/phpunit.xml b/phpunit.xml index 752c2f1..2674de3 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -5,15 +5,14 @@ colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" - convertWarningsToExceptions="true" + convertWarningsToExceptions="false" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" > - ./tests/ - ./tests/app/ + ./tests/PHP70.php + ./tests/PHP71.php diff --git a/tests/PHP70.php b/tests/PHP70.php new file mode 100644 index 0000000..37b4a2a --- /dev/null +++ b/tests/PHP70.php @@ -0,0 +1,19 @@ +middleware = new VeryBasicAuth; + } + + /** Teardown */ + public static function tearDownAfterClass() + { + parent::tearDownAfterClass(); + unlink(__DIR__ . '/../src/config.php'); + } +} diff --git a/tests/PHP71.php b/tests/PHP71.php new file mode 100644 index 0000000..e8e087d --- /dev/null +++ b/tests/PHP71.php @@ -0,0 +1,19 @@ +middleware = new VeryBasicAuth; + } + + /** Teardown */ + public static function tearDownAfterClass(): void + { + parent::tearDownAfterClass(); + unlink(__DIR__ . '/../src/config.php'); + } +} diff --git a/tests/VeryBasicAuthTests.php b/tests/VeryBasicAuthTests.php index add0c99..377e709 100644 --- a/tests/VeryBasicAuthTests.php +++ b/tests/VeryBasicAuthTests.php @@ -1,4 +1,4 @@ -middleware = new VeryBasicAuth; - } + protected $middleware; /** * Load the package @@ -207,7 +203,13 @@ public function test_very_basic_auth_view_incorrect_credentials() $this->assertEquals('Basic realm="' . $realm . '", charset="UTF-8"', $result->headers->get('WWW-Authenticate')); $this->assertEquals(401, $result->getStatusCode()); - $this->assertContains('This is the default view for the l5-very-basic-auth-package', $result->getContent()); + + // PHPUNIT 7.5.6+ + if (method_exists($this, 'assertStringContainsStringIgnoringCase')) { + $this->assertStringContainsStringIgnoringCase('This is the default view for the l5-very-basic-auth-package', $result->getContent()); + } else { + $this->assertContains('This is the default view for the l5-very-basic-auth-package', $result->getContent()); + } } /* test */ @@ -269,11 +271,4 @@ public function test_very_basic_auth_env_wildcard() $this->assertEquals(401, $result->getStatusCode()); $this->assertEquals(config('very_basic_auth.error_message'), $result->getContent()); } - - /** Teardown */ - public static function tearDownAfterClass() - { - parent::tearDownAfterClass(); - unlink(__DIR__ . '/../src/config.php'); - } }