Skip to content

Commit

Permalink
Merge pull request #13 from aik099/phpunit10-support
Browse files Browse the repository at this point in the history
PHPUnit 10 support
  • Loading branch information
aik099 authored Mar 29, 2024
2 parents 42f97fb + 8fc3b77 commit 5182750
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 15 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,27 @@ jobs:

strategy:
matrix:
php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ]
include:
- php: '5.6'
phpunit_config: 'phpunit.xml.dist' # PHPUnit 5.7
- php: '7.0'
phpunit_config: 'phpunit.xml.dist' # PHPUnit 6.5
- php: '7.1'
phpunit_config: 'phpunit7.xml.dist' # PHPUnit 7.5
- php: '7.2'
phpunit_config: 'phpunit7.xml.dist' # PHPUnit 8.5
- php: '7.3'
phpunit_config: 'phpunit9.xml.dist' # PHPUnit 9.6
- php: '7.4'
phpunit_config: 'phpunit9.xml.dist' # PHPUnit 9.6
- php: '8.0'
phpunit_config: 'phpunit9.xml.dist' # PHPUnit 9.6
- php: '8.1'
phpunit_config: 'phpunit10.xml.dist' # PHPUnit 10.5
- php: '8.2'
phpunit_config: 'phpunit10.xml.dist' # PHPUnit 10.5
- php: '8.3'
phpunit_config: 'phpunit10.xml.dist' # PHPUnit 10.5
fail-fast: false

steps:
Expand All @@ -44,7 +64,7 @@ jobs:

- name: Run tests
run: |
vendor/bin/phpunit -v --coverage-clover=coverage.clover
vendor/bin/phpunit --configuration ${{ matrix.phpunit_config }} --coverage-clover=coverage.clover
- name: Upload Coverage to CodeCov
uses: codecov/codecov-action@v2
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"require-dev": {
"aik099/coding-standard": "dev-master",
"yoast/phpunit-polyfills": "^1.0",
"yoast/phpunit-polyfills": "^2.0",
"phpspec/prophecy": "^1.10",
"console-helpers/prophecy-phpunit": "^2.0@dev"
},
Expand Down
16 changes: 8 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<phpunit bootstrap="vendor/autoload.php"
colors="true"
strict="true"
verbose="true">
verbose="true"
displayDetailsOnTestsThatTriggerDeprecations="true">

<testsuites>
<testsuite name="default">
Expand Down
31 changes: 31 additions & 0 deletions phpunit10.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutChangesToGlobalState="true"
cacheDirectory=".phpunit.cache">

<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<!--<logging>
<log type="coverage-html" target="build/coverage" title="BankAccount"
charset="UTF-8" yui="true" highlight="true"
lowUpperBound="35" highLowerBound="70"/>
</logging>-->

<php>
<server name="working_directory" value=".console-kit"/>
</php>

<coverage>
<include>
<directory>src</directory>
</include>
</coverage>
</phpunit>
30 changes: 30 additions & 0 deletions phpunit7.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
colors="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutChangesToGlobalState="true"
verbose="true">

<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<!--<logging>
<log type="coverage-html" target="build/coverage" title="BankAccount"
charset="UTF-8" yui="true" highlight="true"
lowUpperBound="35" highLowerBound="70"/>
</logging>-->

<php>
<server name="working_directory" value=".console-kit"/>
</php>

<filter>
<whitelist>
<directory>src</directory>
</whitelist>
</filter>
</phpunit>
31 changes: 31 additions & 0 deletions phpunit9.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutChangesToGlobalState="true"
verbose="true">

<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<!--<logging>
<log type="coverage-html" target="build/coverage" title="BankAccount"
charset="UTF-8" yui="true" highlight="true"
lowUpperBound="35" highLowerBound="70"/>
</logging>-->

<php>
<server name="working_directory" value=".console-kit"/>
</php>

<coverage>
<include>
<directory>src</directory>
</include>
</coverage>
</phpunit>
3 changes: 0 additions & 3 deletions tests/ConsoleKit/WorkingDirectoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@


use ConsoleHelpers\ConsoleKit\WorkingDirectory;
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;

class WorkingDirectoryTest extends WorkingDirectoryAwareTestCase
{

use ExpectException;

/**
* @dataProvider incorrectSubFolderDataProvider
*/
Expand Down

0 comments on commit 5182750

Please sign in to comment.