Skip to content

Commit

Permalink
Add tests for PHP8.4 and report error thoroughly
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasmullie committed Dec 20, 2024
1 parent 510129d commit 6ca64d5
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m)" -o docker-compose
chmod +x docker-compose
mv docker-compose /usr/local/bin/docker-compose
- name: Test PHP 8.4
run: make test PHP=8.4
- name: Test PHP 8.3
run: make test PHP=8.3
- name: Test PHP 8.2
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog


## [1.5.4] - 2024-12-20
### Fixed
- Fixed PHP 8.4 deprecation of implicit nullable parameters


## [1.5.3] - 2024-04-02
### Fixed
- Fixed Redis TLL override on failure to add key
Expand Down Expand Up @@ -358,3 +363,4 @@
[1.5.1]: https://github.com/matthiasmullie/scrapbook/compare/1.5.0...1.5.1
[1.5.2]: https://github.com/matthiasmullie/scrapbook/compare/1.5.1...1.5.2
[1.5.3]: https://github.com/matthiasmullie/scrapbook/compare/1.5.2...1.5.3
[1.5.4]: https://github.com/matthiasmullie/scrapbook/compare/1.5.3...1.5.4
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ FROM php:$version
WORKDIR /var/www
COPY . .

RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

RUN docker/php.sh
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ services:
dockerfile: Dockerfile
args:
version: cli
volumes:
- ./src:/var/www/src
- ./tests:/var/www/tests
- ./phpunit.xml:/var/www/phpunit.xml
php-8.1:
<<: *default-php
build:
Expand All @@ -26,6 +30,12 @@ services:
<<: *default-php-build
args:
version: 8.3-cli
php-8.4:
<<: *default-php
build:
<<: *default-php-build
args:
version: 8.4.0RC3-cli-bookworm
couchbase:
build:
context: .
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test:
RELEVANT_CONTAINERS="$$TEST_CONTAINER $(filter-out apc flysystem memorystore sqlite, $(shell echo $(ADAPTER) | tr 'A-Z,' 'a-z '))";\
docker-compose up --no-deps --wait -d $$DEPENDENT_CONTAINERS;\
GROUP_ARRAY=($$(echo "$(GROUP)" | tr "," "\n"));\
docker-compose run --no-deps $$VOLUMES $$TEST_CONTAINER env XDEBUG_MODE=coverage vendor/bin/phpunit $${GROUP_ARRAY[@]/#/--group } --testsuite $(ADAPTER) --coverage-clover build/coverage-$(PHP)-$(ADAPTER).clover;\
docker-compose run --no-deps $$VOLUMES $$TEST_CONTAINER env XDEBUG_MODE=coverage vendor/bin/phpunit $${GROUP_ARRAY[@]/#/--group } --testsuite $(ADAPTER) --coverage-clover build/coverage-$(PHP)-$(ADAPTER).clover --configuration=phpunit.xml;\
TEST_STATUS=$$?;\
docker-compose stop -t0 $$RELEVANT_CONTAINERS;\
exit $$TEST_STATUS
Expand Down
11 changes: 10 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd">
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
colors="true"
bootstrap="tests/bootstrap.php"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
>
<coverage>
<report>
<clover outputFile="build/coverage.clover"/>
Expand Down

0 comments on commit 6ca64d5

Please sign in to comment.