Skip to content

Commit

Permalink
PHPUnit 10 Migration (#4)
Browse files Browse the repository at this point in the history
* Bump PHPUnit dependencies

* Ignore PHPUnit cache folder

* Define test classes as `final`

* Update phpunit.xml

* Remove phpunit flags from local dev env

* Refactor away TestCase

---------

Co-authored-by: Shift <shift@laravelshift.com>
  • Loading branch information
olivervogel and laravel-shift committed Feb 28, 2024
1 parent 2f20fbe commit 8612466
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build/
vendor/
.DS_Store
.phpunit.result.cache
/.phpunit.cache
composer.lock
phpunit.xml
coverage/
12 changes: 10 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
"name": "intervention/image-laravel",
"description": "Laravel Integration of Intervention Image",
"homepage": "https://image.intervention.io/",
"keywords": ["image", "gd", "imagick", "watermark", "thumbnail", "resize", "laravel"],
"keywords": [
"image",
"gd",
"imagick",
"watermark",
"thumbnail",
"resize",
"laravel"
],
"license": "MIT",
"authors": [
{
Expand All @@ -17,7 +25,7 @@
"intervention/image": "^3"
},
"require-dev": {
"phpunit/phpunit": "^9",
"phpunit/phpunit": "^10.0",
"orchestra/testbench": "^8.18"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ services:
tests:
build: ./
working_dir: /project
command: bash -c "composer install && ./vendor/bin/phpunit -vvv"
command: bash -c "composer install && ./vendor/bin/phpunit"
volumes:
- ./:/project
32 changes: 11 additions & 21 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
>
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>

<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
</phpunit>
7 changes: 5 additions & 2 deletions tests/FacadeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@

namespace Intervention\Image\Laravel\Tests;

use Error;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Laravel\Facades\Image;
use Orchestra\Testbench\Concerns\WithWorkbench;
use Orchestra\Testbench\TestCase as TestBenchTestCase;
use ReflectionClass;
use TypeError;
use ValueError;

class FacadeTest extends TestCase
final class FacadeTest extends TestBenchTestCase
{
use WithWorkbench;

public function testImageFacadeIsASubclassOfFacade(): void
{
$facade = new ReflectionClass('Illuminate\Support\Facades\Facade');
Expand Down
13 changes: 0 additions & 13 deletions tests/TestCase.php

This file was deleted.

0 comments on commit 8612466

Please sign in to comment.