Skip to content

Commit

Permalink
Merge pull request #37 from mihaileu/feature/migrate-to-phpunit10
Browse files Browse the repository at this point in the history
remove support for php 7.4 and 8.0, and migrate to phpunit 10
  • Loading branch information
mihaileu authored Jan 31, 2024
2 parents 074fe94 + 09fed86 commit 85ebd72
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0', '8.3']
php-version: ['8.1', '8.3']
name: PHP ${{ matrix.php-version }}
steps:
- uses: actions/checkout@v2
Expand All @@ -16,7 +16,7 @@ jobs:
coverage: pcov
php-version: ${{ matrix.php-version }}
tools: pecl, composer:v2
extensions: mongodb-1.9.1
extensions: mongodb-1.13
- name: Composer config
run: composer config --no-plugins allow-plugins.infection/extension-installer true
- name: Composer install
Expand Down
15 changes: 10 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.1",
"ext-json": "*",
"symfony/messenger": "^5.0 || ^6.0 || ^7.0",
"mongodb/mongodb": "^1.8"
"mongodb/mongodb": "^1.12"
},
"require-dev": {
"symfony/serializer": "^5.0 || ^6.0 || ^7.0",
"symfony/property-access": "^5.0 || ^6.0 || ^7.0",
"symfony/var-dumper": "^5.0 || ^6.0 || ^7.0",
"symfony/framework-bundle": "^5.0 || ^6.0 || ^7.0",
"phpunit/phpunit": "^9.5",
"infection/infection": "^0.25.0",
"phpstan/phpstan": "^1.2"
"phpunit/phpunit": "^10.5",
"infection/infection": "^0.27.9",
"phpstan/phpstan": "^1.10"
},
"autoload": {
"psr-4": {
Expand All @@ -40,5 +40,10 @@
"psr-4": {
"EmagTechLabs\\MessengerMongoBundle\\Tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"infection/extension-installer": true
}
}
}
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
- ./:/var/www/html
mongo:
restart: unless-stopped
image: mongo:3.6
image: mongo:6
ports:
- 27017:27017
environment:
Expand Down
15 changes: 10 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
FROM php:8.0-alpine
FROM php:8.3-alpine

WORKDIR /var/www/html

RUN apk update \
&& apk upgrade \
&& apk add --no-cache git zip make autoconf g++ openssl-dev
&& apk add --no-cache git zip make autoconf g++ openssl-dev linux-headers \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS

RUN pecl -q install mongodb-1.9.1 xdebug \
&& docker-php-ext-enable mongodb
RUN pecl -q install mongodb-1.17.2 \
&& docker-php-ext-enable mongodb \
&& pecl -q install xdebug \
&& docker-php-ext-enable xdebug

ENV COMPOSER_MEMORY_LIMIT=-1

RUN curl --silent --show-error https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer \
&& chmod o+x /usr/local/bin/composer
&& chmod o+x /usr/local/bin/composer

ENTRYPOINT ["tail", "-f", "/dev/null"]
4 changes: 2 additions & 2 deletions infection.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
},
"logs": {
"text": "infection.log",
"badge": {
"branch": "master"
"stryker": {
"badge": "master"
}
},
"mutators": {
Expand Down
19 changes: 6 additions & 13 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
failOnRisky="true"
failOnWarning="true"
>
<coverage>
<include>
<directory>./src</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php" failOnRisky="true" failOnWarning="true">
<php>
<ini name="error_reporting" value="-1"/>
</php>
Expand All @@ -20,4 +8,9 @@
<directory>./tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>./src</directory>
</include>
</source>
</phpunit>

0 comments on commit 85ebd72

Please sign in to comment.