Skip to content

Commit 3514b81

Browse files
authored
Add support for PHP 8.2, 8.3, PHPUnit 10 (#3)
1 parent 7739cce commit 3514b81

File tree

6 files changed

+30
-38
lines changed

6 files changed

+30
-38
lines changed

.github/workflows/run-tests.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php: [ 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 ]
11+
php: [ 7.3, 7.4, 8.0, 8.1, 8.2, 8.3 ]
1212
dependency-version: [ prefer-stable ]
1313

1414
name: P${{ matrix.php }} - ${{ matrix.dependency-version }}
@@ -34,11 +34,4 @@ jobs:
3434
run: composer update --prefer-dist --no-interaction --no-progress
3535

3636
- name: Execute tests
37-
run: vendor/bin/phpunit --coverage-clover=coverage.xml
38-
39-
- if: github.event_name == 'push'
40-
name: Run Codacy Coverage Reporter
41-
uses: codacy/codacy-coverage-reporter-action@master
42-
with:
43-
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
44-
coverage-reports: coverage.xml
37+
run: vendor/bin/phpunit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/vendor
22
/phpunit.xml
33
composer.lock
4+
/.phpunit.cache
45
/.phpunit.result.cache

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[![GitHub release](https://img.shields.io/github/release/codezero-be/dotenv-updater.svg?style=flat-square)](https://github.com/codezero-be/dotenv-updater/releases)
44
[![License](https://img.shields.io/packagist/l/codezero/dotenv-updater.svg?style=flat-square)](LICENSE.md)
55
[![Build Status](https://img.shields.io/github/workflow/status/codezero-be/dotenv-updater/Tests/master?style=flat-square&logo=github&logoColor=white&label=tests)](https://github.com/codezero-be/dotenv-updater/actions)
6-
[![Code Coverage](https://img.shields.io/codacy/coverage/6b90492697b14556998607da55510676/master?style=flat-square)](https://app.codacy.com/gh/codezero-be/dotenv-updater)
76
[![Code Quality](https://img.shields.io/codacy/grade/6b90492697b14556998607da55510676/master?style=flat-square)](https://app.codacy.com/gh/codezero-be/dotenv-updater)
87
[![Total Downloads](https://img.shields.io/packagist/dt/codezero/dotenv-updater.svg?style=flat-square)](https://packagist.org/packages/codezero/dotenv-updater)
98

@@ -13,7 +12,7 @@
1312

1413
## ✅ Requirements
1514

16-
- PHP >= 7.1
15+
- PHP >= 7.3
1716

1817
## 📦 Install
1918

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.1|^8.0"
19+
"php": "^7.3|^8.0"
2020
},
2121
"require-dev": {
22-
"illuminate/support": "^5.6|^6.0|^7.0|^8.0|^9.0",
23-
"phpunit/phpunit": "^7.0|^8.0|^9.0"
22+
"phpunit/phpunit": "^9.0|^10.0"
2423
},
2524
"scripts": {
2625
"test": "phpunit"

phpunit.xml.dist

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
backupGlobals="false"
44
bootstrap="vendor/autoload.php"
55
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
96
processIsolation="false"
10-
stopOnFailure="false">
11-
<testsuites>
12-
<testsuite name="Unit">
13-
<directory suffix="Test.php">./tests</directory>
14-
</testsuite>
15-
</testsuites>
16-
<filter>
17-
<whitelist processUncoveredFilesFromWhitelist="true">
18-
<directory suffix=".php">./src</directory>
19-
</whitelist>
20-
</filter>
21-
<php>
22-
<env name="APP_ENV" value="testing"/>
23-
<env name="CACHE_DRIVER" value="array"/>
24-
<env name="SESSION_DRIVER" value="array"/>
25-
<env name="QUEUE_DRIVER" value="sync"/>
26-
</php>
7+
stopOnFailure="false"
8+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
9+
cacheDirectory=".phpunit.cache"
10+
backupStaticProperties="false">
11+
<testsuites>
12+
<testsuite name="Unit">
13+
<directory suffix="Test.php">./tests</directory>
14+
</testsuite>
15+
</testsuites>
16+
<php>
17+
<env name="APP_ENV" value="testing"/>
18+
<env name="CACHE_DRIVER" value="array"/>
19+
<env name="SESSION_DRIVER" value="array"/>
20+
<env name="QUEUE_DRIVER" value="sync"/>
21+
</php>
22+
<source>
23+
<include>
24+
<directory suffix=".php">./src</directory>
25+
</include>
26+
</source>
2727
</phpunit>

tests/DotEnvUpdaterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use CodeZero\DotEnvUpdater\DotEnvUpdater;
66

7-
class DotEnvUpdaterTest extends TestCase
7+
final class DotEnvUpdaterTest extends TestCase
88
{
99
/** @test */
1010
public function it_gets_values_from_an_env_file()
@@ -38,7 +38,7 @@ public function it_gets_values_from_an_env_file()
3838
public function it_adds_a_key_and_value_to_a_new_env_file()
3939
{
4040
$this->deleteEnvFile();
41-
$this->assertFileNotExists($this->getEnvPath());
41+
$this->assertFileDoesNotExist($this->getEnvPath());
4242

4343
$updater = new DotEnvUpdater($this->getEnvPath());
4444

0 commit comments

Comments
 (0)