Skip to content

Commit

Permalink
Switch to forked phploc package and add support for Laravel 10 / PHPU…
Browse files Browse the repository at this point in the history
…nit 10 (#217)

* Switch to stefanzweifel/laravel-stats-phploc

* Support laravel/browser-kit-testing v7

* Test against different PHPUnit Versions

* Upgrade phpunit.xml

* Upgrade actions/checkout to v3

* Exclude Stub Tests from PHPUnit
  • Loading branch information
stefanzweifel authored Mar 18, 2023
1 parent 98024a0 commit 025094d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ jobs:

runs-on: ubuntu-latest
strategy:
fail-fast: true
fail-fast: false
matrix:
php: [8.0, 8.1, 8.2]
laravel: [9.*, 10.*]
phpunit: [9.*, 10.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 9.*
Expand All @@ -20,12 +21,14 @@ jobs:
exclude:
- laravel: 10.*
php: 8.0
- laravel: 9.*
phpunit: 10.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
name: P${{ matrix.php }} - L${{ matrix.laravel }} PU${{ matrix.phpunit }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v3

- name: Cache dependencies
uses: actions/cache@v1
Expand All @@ -43,7 +46,7 @@ jobs:

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "phpunit/phpunit:${{ matrix.phpunit }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
"ext-json": "*",
"illuminate/console": "^9.0 | ^10.0",
"illuminate/support": "^9.0 | ^10.0",
"phploc/phploc": "^7.0",
"stefanzweifel/laravel-stats-phploc": "^7.0 | ^8.0",
"symfony/finder": "^6.0",
"symfony/process": "^6.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.2",
"laravel/browser-kit-testing": "^6.0",
"laravel/browser-kit-testing": "^6.0 | ^7.0",
"laravel/dusk": "^6.0|^7.0",
"livewire/livewire": "^2.0",
"mockery/mockery": "^1.1",
"orchestra/testbench": "^7.0 | ^8.0",
"phpunit/phpunit": "^9.0 | ^10",
"phpunit/phpunit": "^9.0 | ^10.0",
"rector/rector": "^0.15",
"vimeo/psalm": "^5.0"
},
Expand Down
5 changes: 4 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<coverage>
<include>
<directory suffix=".php">src/</directory>
Expand All @@ -8,6 +8,9 @@
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
<exclude>./tests/Stubs/Tests/DemoBrowserKit.php</exclude>
<exclude>./tests/Stubs/Tests/DemoDuskTest.php</exclude>
<exclude>./tests/Stubs/Tests/DemoUnitTest.php</exclude>
</testsuite>
</testsuites>
</phpunit>

0 comments on commit 025094d

Please sign in to comment.