Skip to content

Commit 0a2ad75

Browse files
authored
Upgrade to PHP 8.1 (#2)
* Updated PHP requirement to >=8.0 * Updated Codeception to ^5 * Added github workflow * Switched `kodus/uuid-v4` to dev branch temporarily * Replace `zendframework/zend-diactoros` with `nyholm/psr7` * Updated PHP version badge * Updated `kodus/uuid-v4` to ^1.2
1 parent 94a515f commit 0a2ad75

8 files changed

+39
-15
lines changed

.github/workflows/test.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Codeception tests
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
name: ${{matrix.operating-system}}, PHP ${{ matrix.php }}
8+
9+
runs-on: ${{ matrix.operating-system }}
10+
11+
strategy:
12+
matrix:
13+
operating-system: [ ubuntu-latest, ubuntu-20.04 ]
14+
php: [ '8.0', '8.1' ]
15+
16+
steps:
17+
- uses: actions/checkout@master
18+
19+
- name: Setup PHP
20+
uses: nanasess/setup-php@master
21+
with:
22+
php-version: ${{ matrix.php }}
23+
24+
- name: Install dependencies
25+
run: composer install
26+
27+
- name: Run tests
28+
run: php vendor/bin/codecept run

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ recovery of [PSR-7](http://www.php-fig.org/psr/psr-7/) `UploadedFile` objects.
77
A dedicated [FlySystem](https://flysystem.thephpleague.com/) port is
88
[also available](https://github.com/kodus/tempkit-fs).
99

10-
[![PHP Version](https://img.shields.io/badge/php-7.0%2B-blue.svg)](https://packagist.org/packages/kodus/tempkit)
10+
[![PHP Version](https://img.shields.io/badge/php-8.0%2B-blue.svg)](https://packagist.org/packages/kodus/tempkit)
1111

1212
You can use this service to implement controllers that collect uploaded files
1313
posted asynchronously by a browser and return the temporary file UUIDs, then,

codeception.dist.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
actor: Tester
22
paths:
33
tests: tests
4-
log: tests/_output
4+
output: tests/_output
55
data: tests/_data
66
support: tests/_support
77
envs: tests/_envs
88
settings:
9-
bootstrap: _bootstrap.php
10-
colors: false
119
memory_limit: 1024M
1210
extensions:
1311
enabled:

composer.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
}
1414
},
1515
"require": {
16-
"php": ">= 7",
16+
"php": ">= 8.0",
1717
"psr/http-message": "^1.0",
18-
"kodus/uuid-v4": "^1.1"
18+
"kodus/uuid-v4": "^1.2"
1919
},
2020
"require-dev": {
21-
"zendframework/zend-diactoros": "^1.4",
22-
"codeception/codeception": "^2.2"
21+
"nyholm/psr7": "^1.5",
22+
"codeception/codeception": "^5",
23+
"codeception/module-asserts": "^3.0"
2324
}
2425
}

tests/_bootstrap.php

-2
This file was deleted.

tests/unit.suite.dist.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class_name: UnitTester
1+
actor: UnitTester
22
modules:
33
enabled:
44
- Helper\Unit

tests/unit/TempFileServiceCest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
use Kodus\TempKit\TempFile;
88
use Kodus\TempKit\TempFileRecoveryException;
99
use Kodus\TempKit\TempFileService;
10+
use Nyholm\Psr7\Stream;
11+
use Nyholm\Psr7\UploadedFile;
1012
use UnitTester;
11-
use Zend\Diactoros\Stream;
12-
use Zend\Diactoros\UploadedFile;
1313

1414
class TempFileServiceCest
1515
{
@@ -104,7 +104,7 @@ public function flushesExpiredFiles(UnitTester $I)
104104
file_put_contents($uploaded_file_path, $file_contents);
105105

106106
return new UploadedFile(
107-
new Stream($uploaded_file_path),
107+
Stream::create(fopen($uploaded_file_path, 'r')),
108108
strlen($file_contents),
109109
UPLOAD_ERR_OK,
110110
self::FILENAME,

tests/unit/_bootstrap.php

-1
This file was deleted.

0 commit comments

Comments
 (0)