Skip to content
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ jobs:
matrix:
php: [ '8.0', '7.4', '7.3' ]
dependency-version: [ '' ]
platform-reqs: [ '' ]
include:
- php: '7.3'
dependency-version: '--prefer-lowest'
- php: '8.1'
platform-reqs: '--ignore-platform-req=php' # see https://github.com/phpspec/prophecy/pull/533#issuecomment-891606803
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still relevant now that the PR has been merged?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR is merged but prophecy is not released and it won't be until php8.1 issues are fixed. I think it can be merged as is and removed when prophecy is compatible (it will be around RC1 apparently).

steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -37,14 +40,15 @@ jobs:
ini-values: expose_php=1
# See https://github.com/shivammathur/setup-php/issues/280
- name: Setup php-fpm
if: ${{ matrix.php != '8.1' }}
env:
version: ${{ matrix.php }}
run: |
sudo apt-get install -y php$version-fpm
sudo cp /usr/sbin/php-fpm$version /usr/bin/php-fpm # copy to /usr/bin
echo 'expose_php=1' | sudo tee -a /etc/php/$version/fpm/php.ini
- name: Install dependencies
run: 'composer update ${{ matrix.dependency-version }} --no-interaction --prefer-dist --no-progress'
run: 'composer update ${{ matrix.dependency-version }} --no-interaction --prefer-dist --no-progress ${{ matrix.platform-reqs }}'
- name: Execute Unit Tests
run: 'vendor/bin/phpunit --testsuite small'

Expand Down
15 changes: 13 additions & 2 deletions tests/Handler/FpmHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,8 @@ public function test POST request with multipart file uploads(int $version
],
'body' => $body,
];
$this->assertGlobalVariables($event, [

$expectedGlobalVariables = [
'$_GET' => [],
'$_POST' => [],
'$_FILES' => [
Expand All @@ -742,13 +743,15 @@ public function test POST request with multipart file uploads(int $version
'error' => 0,
'size' => 57,
'content' => "Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit.\n",
'full_path' => 'lorem.txt',
],
'bar' => [
'name' => 'cars.csv',
'type' => '',
'error' => 0,
'size' => 51,
'content' => "Year,Make,Model\n1997,Ford,E350\n2000,Mercury,Cougar\n",
'full_path' => 'cars.csv',
],
],
'$_COOKIE' => [],
Expand All @@ -767,7 +770,15 @@ public function test POST request with multipart file uploads(int $version
'LAMBDA_REQUEST_CONTEXT' => '[]',
],
'HTTP_RAW_BODY' => '',
]);
];

if (\PHP_VERSION_ID < 80100) {
// full_path was introduced in PHP 8.1, remove it for lower versions
unset($expectedGlobalVariables['$_FILES']['foo']['full_path']);
unset($expectedGlobalVariables['$_FILES']['bar']['full_path']);
}

$this->assertGlobalVariables($event, $expectedGlobalVariables);
}

/**
Expand Down