Skip to content

Commit

Permalink
Add support for PHP 8.2, 8.3, PHPUnit 10 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvermeyen authored Mar 28, 2024
1 parent 7739cce commit 3514b81
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 38 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 ]
php: [ 7.3, 7.4, 8.0, 8.1, 8.2, 8.3 ]
dependency-version: [ prefer-stable ]

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

- name: Execute tests
run: vendor/bin/phpunit --coverage-clover=coverage.xml

- if: github.event_name == 'push'
name: Run Codacy Coverage Reporter
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
run: vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/vendor
/phpunit.xml
composer.lock
/.phpunit.cache
/.phpunit.result.cache
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[![GitHub release](https://img.shields.io/github/release/codezero-be/dotenv-updater.svg?style=flat-square)](https://github.com/codezero-be/dotenv-updater/releases)
[![License](https://img.shields.io/packagist/l/codezero/dotenv-updater.svg?style=flat-square)](LICENSE.md)
[![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)
[![Code Coverage](https://img.shields.io/codacy/coverage/6b90492697b14556998607da55510676/master?style=flat-square)](https://app.codacy.com/gh/codezero-be/dotenv-updater)
[![Code Quality](https://img.shields.io/codacy/grade/6b90492697b14556998607da55510676/master?style=flat-square)](https://app.codacy.com/gh/codezero-be/dotenv-updater)
[![Total Downloads](https://img.shields.io/packagist/dt/codezero/dotenv-updater.svg?style=flat-square)](https://packagist.org/packages/codezero/dotenv-updater)

Expand All @@ -13,7 +12,7 @@

## ✅ Requirements

- PHP >= 7.1
- PHP >= 7.3

## 📦 Install

Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
}
],
"require": {
"php": "^7.1|^8.0"
"php": "^7.3|^8.0"
},
"require-dev": {
"illuminate/support": "^5.6|^6.0|^7.0|^8.0|^9.0",
"phpunit/phpunit": "^7.0|^8.0|^9.0"
"phpunit/phpunit": "^9.0|^10.0"
},
"scripts": {
"test": "phpunit"
Expand Down
44 changes: 22 additions & 22 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
</php>
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
</php>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
4 changes: 2 additions & 2 deletions tests/DotEnvUpdaterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use CodeZero\DotEnvUpdater\DotEnvUpdater;

class DotEnvUpdaterTest extends TestCase
final class DotEnvUpdaterTest extends TestCase
{
/** @test */
public function it_gets_values_from_an_env_file()
Expand Down Expand Up @@ -38,7 +38,7 @@ public function it_gets_values_from_an_env_file()
public function it_adds_a_key_and_value_to_a_new_env_file()
{
$this->deleteEnvFile();
$this->assertFileNotExists($this->getEnvPath());
$this->assertFileDoesNotExist($this->getEnvPath());

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

Expand Down

0 comments on commit 3514b81

Please sign in to comment.