Skip to content

Commit c7d0c0f

Browse files
committed
Update phpunit.xml.dist
1 parent 3e8186e commit c7d0c0f

18 files changed

+315
-30
lines changed

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
/.gitignore export-ignore
77
/.travis.yml export-ignore
88
/.styleci.yml export-ignore
9-
/phpunit.xml.dist export-ignore
10-
/phpunit.xml export-ignore
119
/readme.md export-ignore
1210
/phpunit.bat export-ignore
1311
/.scrutinizer.yml export-ignore
1412
/tests export-ignore
1513
/.editorconfig export-ignore
14+
/phpunit_conf export-ignore

.github/workflows/code_coverage.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Code Coverage
2+
3+
# Controls when the workflow will run
4+
on:
5+
push:
6+
branches: [master]
7+
pull_request:
8+
branches: [master]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
test:
16+
# The type of runner that the job will run on
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: true
20+
matrix:
21+
os: [ubuntu-latest]
22+
php: [8.3]
23+
laravel: [10.*]
24+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - OS ${{ matrix.os }}
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 3
31+
- name: Setup PHP v${{ matrix.php }}
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: ${{ matrix.php }}
35+
extensions: mbstring, exif, iconv, tokenizer, fileinfo, xdebug
36+
coverage: xdebug
37+
38+
- name: Install dependencies
39+
run: |
40+
composer require "laravel/framework=${{ matrix.laravel }}" --no-update
41+
composer update --prefer-dist --no-interaction --no-progress
42+
43+
- name: PHPUnit
44+
run: |
45+
./vendor/bin/phpunit --stop-on-failure --coverage-clover ./clover.xml -c ./phpunit_conf/coverage.xml.dist
46+
env:
47+
XDEBUG_MODE: coverage
48+
49+
#- name: Make code coverage badge
50+
# uses: timkrase/phpunit-coverage-badge@v1.2.1
51+
# with:
52+
# coverage_badge_path: output/coverage.svg
53+
# repo_token: ${{ secrets.GITHUB_TOKEN }}
54+
# push_badge: true
55+
- name: Upload coverage results to Coveralls
56+
env:
57+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
run: |
59+
composer global require php-coveralls/php-coveralls
60+
php-coveralls --coverage_clover=./clover.xml --json_path=./coverall.xml -v

.github/workflows/tests.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
matrix:
2121
os: [ubuntu-latest, windows-latest]
2222
php: [7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3]
23-
laravel: [6.*, 7.*, 8.*, 9.*, 10.*, 11.*]
23+
laravel: [6.*, 7.*, 8.*, 9.*, 10.*]
2424
exclude:
2525
- php: 7.2
2626
laravel: 8.*
@@ -62,12 +62,15 @@ jobs:
6262
laravel: 11.*
6363
- php: 8.0
6464
laravel: 11.*
65+
- php: 8.1
66+
laravel: 11.*
6567
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - OS ${{ matrix.os }}
6668

6769
steps:
6870
- name: Checkout code
6971
uses: actions/checkout@v2
70-
72+
with:
73+
fetch-depth: 1
7174
- name: Setup PHP
7275
uses: shivammathur/setup-php@v2
7376
with:
@@ -79,5 +82,6 @@ jobs:
7982
run: |
8083
composer require "laravel/framework=${{ matrix.laravel }}" --no-update
8184
composer update --prefer-dist --no-interaction --no-progress
82-
- name: Run tests
83-
run: vendor/bin/phpunit
85+
- name: PHPUnit
86+
run: |
87+
./vendor/bin/phpunit --stop-on-failure -c ./phpunit_conf/phpunit_${{ matrix.php }}.xml.dist

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Laravel Widgetize
1616
[![Latest Stable Version](https://poser.pugx.org/imanghafoori/laravel-widgetize/v/stable)](https://packagist.org/packages/imanghafoori/laravel-widgetize)
1717
[![Awesome Laravel](https://img.shields.io/badge/Awesome-Laravel-brightgreen.svg)](https://github.com/chiraggude/awesome-laravel)
1818
[![Monthly Downloads](https://poser.pugx.org/imanghafoori/laravel-widgetize/d/monthly)](https://packagist.org/packages/imanghafoori/laravel-widgetize/stats)
19-
[![Code Coverage](https://scrutinizer-ci.com/g/imanghafoori1/laravel-widgetize/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/imanghafoori1/laravel-widgetize/?branch=master)
19+
[![Coverage Status](https://coveralls.io/repos/github/imanghafoori1/laravel-widgetize/badge.svg?branch=master)](https://coveralls.io/github/imanghafoori1/laravel-widgetize?branch=master)
2020
[![tests](https://github.com/imanghafoori1/laravel-widgetize/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/imanghafoori1/laravel-widgetize/actions/workflows/tests.yml)
2121
[![Imports](https://github.com/imanghafoori1/laravel-widgetize/actions/workflows/imports.yml/badge.svg?branch=master)](https://github.com/imanghafoori1/laravel-widgetize/actions/workflows/imports.yml)
2222
</p>

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
},
2222
"require-dev": {
23-
"orchestra/testbench": "~3.0|~4.0|~5.0|~6.0|~7.0|~8.0",
23+
"orchestra/testbench": "~3.0|~4.0|~5.0|~6.0|~7.0|~8.0|~9.0|~10.0",
2424
"imanghafoori/php-imports-analyzer": "1.0.*",
2525
"barryvdh/laravel-debugbar": ">=v1.0.0",
2626
"mockery/mockery": ">=0.9"

phpunit.xml.dist

Lines changed: 0 additions & 22 deletions
This file was deleted.

phpunit_conf/coverage.xml.dist

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="./../vendor/autoload.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" backupGlobals="false" colors="true" processIsolation="false" stopOnError="false" stopOnFailure="false" cacheDirectory=".phpunit.cache">
3+
<testsuites>
4+
<testsuite name="default">
5+
<directory>./../tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
<php>
9+
<env name="APP_ENV" value="testing"/>
10+
<env name="CACHE_DRIVER" value="array"/>
11+
<env name="SESSION_DRIVER" value="array"/>
12+
</php>
13+
<source>
14+
<include>
15+
<directory suffix=".php">./../src</directory>
16+
</include>
17+
<exclude/>
18+
</source>
19+
</phpunit>

phpunit_conf/phpunit_7.2.xml.dist

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
4+
bootstrap="./../vendor/autoload.php"
5+
executionOrder="depends,defects"
6+
beStrictAboutOutputDuringTests="true"
7+
failOnRisky="true"
8+
failOnWarning="true"
9+
backupGlobals="false"
10+
colors="true"
11+
processIsolation="false"
12+
stopOnError="false"
13+
stopOnFailure="false"
14+
>
15+
16+
<testsuites>
17+
<testsuite name="default">
18+
<directory>./../tests</directory>
19+
</testsuite>
20+
</testsuites>
21+
22+
<filter>
23+
<whitelist processUncoveredFilesFromWhitelist="true">
24+
<directory suffix=".php">./../src</directory>
25+
<exclude></exclude>
26+
</whitelist>
27+
</filter>
28+
<php>
29+
<env name="APP_ENV" value="testing"/>
30+
<env name="CACHE_DRIVER" value="array"/>
31+
<env name="SESSION_DRIVER" value="array"/>
32+
</php>
33+
</phpunit>

phpunit_conf/phpunit_7.3.xml.dist

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
4+
bootstrap="./../vendor/autoload.php"
5+
executionOrder="depends,defects"
6+
beStrictAboutOutputDuringTests="true"
7+
failOnRisky="true"
8+
failOnWarning="true"
9+
backupGlobals="false"
10+
colors="true"
11+
processIsolation="false"
12+
stopOnError="false"
13+
stopOnFailure="false"
14+
>
15+
16+
<testsuites>
17+
<testsuite name="default">
18+
<directory>./../tests</directory>
19+
</testsuite>
20+
</testsuites>
21+
22+
<filter>
23+
<whitelist processUncoveredFilesFromWhitelist="true">
24+
<directory suffix=".php">./../src</directory>
25+
<exclude></exclude>
26+
</whitelist>
27+
</filter>
28+
<php>
29+
<env name="APP_ENV" value="testing"/>
30+
<env name="CACHE_DRIVER" value="array"/>
31+
<env name="SESSION_DRIVER" value="array"/>
32+
</php>
33+
</phpunit>

phpunit_conf/phpunit_7.4.xml.dist

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
4+
bootstrap="./../vendor/autoload.php"
5+
executionOrder="depends,defects"
6+
beStrictAboutOutputDuringTests="true"
7+
failOnRisky="true"
8+
failOnWarning="true"
9+
backupGlobals="false"
10+
colors="true"
11+
processIsolation="false"
12+
stopOnError="false"
13+
stopOnFailure="false"
14+
>
15+
16+
<testsuites>
17+
<testsuite name="default">
18+
<directory>./../tests</directory>
19+
</testsuite>
20+
</testsuites>
21+
22+
<filter>
23+
<whitelist processUncoveredFilesFromWhitelist="true">
24+
<directory suffix=".php">./../src</directory>
25+
<exclude></exclude>
26+
</whitelist>
27+
</filter>
28+
<php>
29+
<env name="APP_ENV" value="testing"/>
30+
<env name="CACHE_DRIVER" value="array"/>
31+
<env name="SESSION_DRIVER" value="array"/>
32+
</php>
33+
</phpunit>

0 commit comments

Comments
 (0)