Skip to content

Commit

Permalink
Support PHP 8.1+
Browse files Browse the repository at this point in the history
  • Loading branch information
svenluijten committed Aug 11, 2023
1 parent d12ea0f commit 4e9574e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
php: [8.0, 8.1, 8.2]
php: [8.1, 8.2]
dependency-version: [highest, lowest]

steps:
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Expand Up @@ -17,12 +17,12 @@
],
"require": {
"php": "^8.0",
"illuminate/console": "^8.22 || ^9.0 || ^10.0",
"illuminate/console": "^9.0 || ^10.0",
"sven/file-config": "^3.1.0"
},
"require-dev": {
"graham-campbell/testbench": "^6.0",
"phpunit/phpunit": "^9.0 || ^10.0",
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^10.0",
"mockery/mockery": "^1.4"
},
"autoload": {
Expand Down
20 changes: 10 additions & 10 deletions phpunit.xml.dist
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
backupGlobals="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="./vendor/autoload.php"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
>
<testsuites>
<testsuite name="Flex Env Test Suite">
<directory suffix=".php">./tests</directory>
</testsuite>
</testsuites>
<testsuites>
<testsuite name="Flex Env Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
</phpunit>
2 changes: 0 additions & 2 deletions tests/Feature/EnvDeleteTest.php
Expand Up @@ -17,7 +17,6 @@ public function it_can_delete_an_entry(): void
);

$this->artisan('env:delete FOO')
// ->expectsConfirmation('Are you sure you want to delete "FOO" from your .env file?', 'yes')
->expectsQuestion('Are you sure you want to delete "FOO" from your .env file?', true)
->expectsOutput('Successfully deleted the entry "FOO" from your .env file.')
->assertExitCode(0);
Expand Down Expand Up @@ -63,7 +62,6 @@ public function it_does_not_delete_the_entry_when_no_is_answered(): void
);

$this->artisan('env:delete FOO')
// ->expectsConfirmation('Are you sure you want to delete "FOO" from your .env file?', 'no')
->expectsQuestion('Are you sure you want to delete "FOO" from your .env file?', false)
->expectsOutput('Alright, no changes made.')
->assertExitCode(1);
Expand Down
18 changes: 7 additions & 11 deletions tests/TestCase.php
Expand Up @@ -3,23 +3,19 @@
namespace Sven\FlexEnv\Tests;

use GrahamCampbell\TestBench\AbstractPackageTestCase;
use Orchestra\Testbench\TestCase as OrchestraTestCase;
use Sven\FlexEnv\ServiceProvider;

abstract class TestCase extends AbstractPackageTestCase
abstract class TestCase extends OrchestraTestCase
{
public static function getServiceProviderClass(): string
protected function getEnvironmentSetUp($app): void
{
return ServiceProvider::class;
}

protected function setUp(): void
{
parent::setUp();

file_put_contents(__DIR__.'/assets/.env.test', '');

$this->app->useEnvironmentPath(__DIR__.'/assets');
$this->app->loadEnvironmentFrom('.env.test');
$app->useEnvironmentPath(__DIR__.'/assets');
$app->loadEnvironmentFrom('.env.test');

$app->register(ServiceProvider::class);
}

protected function tearDown(): void
Expand Down

0 comments on commit 4e9574e

Please sign in to comment.