Skip to content

Commit

Permalink
PHP 8.0 Support (#256)
Browse files Browse the repository at this point in the history
* run test suite with PHP 8.0

* require php8 supported versions

* migrate phpunit xml config to newest scheme

* require higher orchestra/testbench versions

getAnnotations() in Testcase is deprecated, these versions use PHPUnit\Util\Test to parse annotations instead of relying on deprecated TestCase::getAnnotations()

* require php8 compatible version

* use fakerPHP instead of fzaninotto

Co-authored-by: Devin <[email protected]>
  • Loading branch information
Nielsvanpach and DevinCodes authored Jan 4, 2021
1 parent 875504f commit 89e87b2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ aliases:

- &install_dependencies
name: Install Composer dependencies
command: COMPOSER_MEMORY_LIMIT=-1 composer require "illuminate/contracts=<<parameters.laravel>>" --dev --prefer-dist --no-interaction --no-suggest
command: COMPOSER_MEMORY_LIMIT=-1 composer require "illuminate/contracts=<<parameters.laravel>>" --dev --prefer-dist --no-interaction

- &save_cache
name: save Composer cache
Expand Down Expand Up @@ -80,5 +80,5 @@ workflows:
- test:
matrix:
parameters:
version: ['7.3', '7.4']
version: ['7.3', '7.4', '8.0']
laravel: ['^6.0', '^7.0', '^8.0']
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
}
],
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"ext-json": "*",
"algolia/algoliasearch-client-php": "^2.5.1",
"algolia/algoliasearch-client-php": "^2.7.3",
"illuminate/console": "^6.0|^7.0|^8.0",
"illuminate/contracts": "^6.0|^7.0|^8.0",
"illuminate/database": "^6.0|^7.0|^8.0",
Expand All @@ -29,13 +29,13 @@
"ext-dom": "Required to use the HTML Splitter."
},
"require-dev": {
"fzaninotto/faker": "^1.8",
"mockery/mockery": "^1.1",
"fakerphp/faker": "^1.13",
"mockery/mockery": "^1.4",
"nunomaduro/larastan": "^0.6",
"orchestra/testbench": "^4.9|^5.9|^6.6",
"phpstan/phpstan": "^0.12.14",
"phpunit/phpunit": "^8.0|^9.0",
"laravel/legacy-factories": "^1.0"
"laravel/legacy-factories": "^1.1"
},
"autoload-dev": {
"psr-4": {
Expand Down
37 changes: 11 additions & 26 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutTestsThatDoNotTestAnything="false"
beStrictAboutOutputDuringTests="true"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
failOnRisky="true"
failOnWarning="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
verbose="true"
>
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" beStrictAboutTestsThatDoNotTestAnything="false" beStrictAboutOutputDuringTests="true" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" failOnRisky="true" failOnWarning="true" processIsolation="false" stopOnError="false" stopOnFailure="false" verbose="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
</phpunit>

0 comments on commit 89e87b2

Please sign in to comment.