Skip to content

Commit

Permalink
php 8+ only, usable with phpunit 10 and 11
Browse files Browse the repository at this point in the history
  • Loading branch information
Zrnik committed Mar 9, 2024
1 parent e27a434 commit 1568e84
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
```

Expand Down
2 changes: 1 addition & 1 deletion src/ThrownResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final private function __construct(
Throwable $throwable
)
{
$this->type = static::getExceptionType($throwable);
$this->type = self::getExceptionType($throwable);
$this->throwable = $throwable;
}

Expand Down

0 comments on commit 1568e84

Please sign in to comment.