diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a7445c8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM php:8.3-fpm +RUN apt -y update && apt -y install git unzip +COPY --from=composer/composer:2-bin /composer /usr/bin/composer diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6650ae4 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +build: + docker build . -t phpunit_exceptions_image -f Dockerfile + +composer-update: build + docker run -w /app -v $(shell pwd):/app phpunit_exceptions_image composer update + sudo chmod 777 -R vendor + +composer-install: build + docker run -w /app -v $(shell pwd):/app phpunit_exceptions_image composer install + sudo chmod 777 -R vendor + +phpstan: + docker run -w /app -v $(shell pwd):/app phpunit_exceptions_image composer phpstan + +phpunit: + docker run -w /app -v $(shell pwd):/app phpunit_exceptions_image composer phpunit diff --git a/composer.json b/composer.json index 3f6cf0d..e3aee0b 100644 --- a/composer.json +++ b/composer.json @@ -19,12 +19,12 @@ } }, "require": { - "php": ">=7.4|>=8.0", - "phpunit/phpunit": "^9" + "php": "^8", + "phpunit/phpunit": "^9|^10|^11" }, "require-dev": { "roave/security-advisories": "dev-latest", - "phpstan/phpstan": "^0.12" + "phpstan/phpstan": "^1" }, "scripts": { "phpunit": "phpunit tests", diff --git a/readme.md b/readme.md index d0f90b0..1939b06 100644 --- a/readme.md +++ b/readme.md @@ -6,7 +6,8 @@ Trait for easier exception testing in [PHPUnit](https://github.com/sebastianberg ``` { - "php": ">=7.4|>=8.0" + "php": "^8", + "phpunit/phpunit": "^9|^10|^11" } ``` diff --git a/src/ThrownResult.php b/src/ThrownResult.php index ead5853..d6be370 100644 --- a/src/ThrownResult.php +++ b/src/ThrownResult.php @@ -13,7 +13,7 @@ final private function __construct( Throwable $throwable ) { - $this->type = static::getExceptionType($throwable); + $this->type = self::getExceptionType($throwable); $this->throwable = $throwable; }