diff --git a/.travis.yml b/.travis.yml index 77c5ea3..bbca139 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,6 @@ cache: - $HOME/.composer/cache/files php: - - 5.5 - - 5.6 - - 7.0 - 7.1 - 7.2 - 7.3 @@ -24,18 +21,18 @@ branches: - /^analysis-.*$/ matrix: - allow_failures: - - php: 7.3 fast_finish: true include: - name: PHPSpec code coverage - php: 5.5 - env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci" PULI_VERSION=1.0.0-beta9 DEPENDENCIES="henrikbjorn/phpspec-code-coverage:^2.0.2" + php: 7.1 + # Disable code coverage until https://github.com/leanphp/phpspec-code-coverage/pull/38 is released + # DEPENDENCIES="leanphp/phpspec-code-coverage:^4.2" TEST_COMMAND="composer test-ci" + env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test" PULI_VERSION=1.0.0-beta9 - name: PHPUnit tests - php: 7.2 + php: 7.3 env: TEST_COMMAND="./vendor/bin/phpunit" DEPENDENCIES="phpunit/phpunit:^7.5 nyholm/psr7:^1.0 kriswallsmith/buzz:^1.0@beta php-http/curl-client:^1.0 php-http/message" - name: PHPUnit test with nothing installed - php: 7.2 + php: 7.3 env: TEST_COMMAND="./vendor/bin/phpunit --group=NothingInstalled" DEPENDENCIES="phpunit/phpunit:^7.5" before_install: diff --git a/composer.json b/composer.json index e6b6414..7a8e424 100644 --- a/composer.json +++ b/composer.json @@ -11,13 +11,14 @@ } ], "require": { - "php": "^5.5 || ^7.0" + "php": "^7.1" }, "require-dev": { "php-http/httplug": "^1.0 || ^2.0", "php-http/message-factory": "^1.0", "puli/composer-plugin": "1.0.0-beta10", - "phpspec/phpspec": "^2.4" + "phpspec/phpspec": "^5.1", + "akeneo/phpspec-skip-example-extension": "^4.0" }, "suggest": { "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details.", @@ -39,7 +40,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.7-dev" } }, "conflict": { diff --git a/phpspec.ci.yml b/phpspec.ci.yml index fc7033d..1cc37e3 100644 --- a/phpspec.ci.yml +++ b/phpspec.ci.yml @@ -5,7 +5,8 @@ suites: formatter.name: pretty bootstrap: spec/autoload.php extensions: - - PhpSpec\Extension\CodeCoverageExtension + LeanPHP\PhpSpec\CodeCoverage\CodeCoverageExtension: ~ + Akeneo\SkipExampleExtension: ~ code_coverage: format: clover output: build/coverage.xml diff --git a/phpspec.yml.dist b/phpspec.yml.dist index 65d218e..2707b63 100644 --- a/phpspec.yml.dist +++ b/phpspec.yml.dist @@ -4,3 +4,5 @@ suites: psr4_prefix: Http\Discovery formatter.name: pretty bootstrap: spec/autoload.php +extensions: + Akeneo\SkipExampleExtension: ~ diff --git a/spec/Strategy/PuliSpec.php b/spec/Strategy/PuliSpec.php index 4be65f9..f3765a2 100644 --- a/spec/Strategy/PuliSpec.php +++ b/spec/Strategy/PuliSpec.php @@ -11,6 +11,9 @@ use Puli\Repository\Api\ResourceRepository; use PhpSpec\ObjectBehavior; +/** + * @require \NotPHP73 + */ class PuliSpec extends ObjectBehavior { function let( @@ -67,7 +70,7 @@ function it_returns_a_class_binding_with_dependency( } - public function getMatchers() + public function getMatchers(): array { return [ 'haveCandidate' => function ($subject, $class, $condition) { diff --git a/spec/autoload.php b/spec/autoload.php index 1f0ffd1..3b1228e 100644 --- a/spec/autoload.php +++ b/spec/autoload.php @@ -7,3 +7,9 @@ 'Puli\\GeneratedPuliFactory' => __DIR__.'/../.puli/GeneratedPuliFactory.php', ]); } + +if (PHP_VERSION_ID >= 70300 && PHP_VERSION_ID < 70400) { + class PHP73 {} +} else { + class NotPHP73 {} +}