Skip to content

Commit f04be8e

Browse files
Fix and enable tests on PHP 8
1 parent d57ebe8 commit f04be8e

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

.github/workflows/phpunit.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
dependencies:
16-
- "lowest"
17-
- "highest"
18-
- "locked"
1915
php-version:
2016
- "7.1"
2117
- "7.2"
2218
- "7.3"
2319
- "7.4"
20+
- "8.0"
2421
operating-system:
2522
- "ubuntu-latest"
2623

@@ -42,20 +39,15 @@ jobs:
4239
path: |
4340
~/.composer/cache
4441
vendor
45-
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
46-
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
42+
key: "php-${{ matrix.php-version }}"
43+
restore-keys: "php-${{ matrix.php-version }}"
4744

48-
- name: "Install lowest dependencies"
49-
if: ${{ matrix.dependencies == 'lowest' }}
50-
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
45+
- name: "Configure for PHP 8"
46+
if: ${{ matrix.php-version == '8.0' }}
47+
run: "composer config platform.php 7.4.99"
5148

52-
- name: "Install highest dependencies"
53-
if: ${{ matrix.dependencies == 'highest' }}
54-
run: "composer update --no-interaction --no-progress --no-suggest"
49+
- name: "Test with lowest dependencies"
50+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest && vendor/bin/simple-phpunit"
5551

56-
- name: "Install locked dependencies"
57-
if: ${{ matrix.dependencies == 'locked' }}
58-
run: "composer install --no-interaction --no-progress --no-suggest"
59-
60-
- name: "Tests"
61-
run: "vendor/bin/simple-phpunit"
52+
- name: "Test with highest dependencies"
53+
run: "composer update --no-interaction --no-progress --no-suggest && vendor/bin/simple-phpunit"

tests/language-feature-scripts/lazy-loading-value-holder-internal-php-classes.phpt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
--TEST--
22
Verifies that lazy loading value holder factory can generate proxy for PHP core classes.
33
?>
4+
--SKIPIF--
5+
<?php
6+
7+
require_once __DIR__ . '/init.php';
8+
9+
try {
10+
if (PHP_VERSION_ID >= 80000) {
11+
Laminas\Code\Generator\TypeGenerator::fromTypeString('array|string');
12+
}
13+
} catch (\InvalidArgumentException $e) {
14+
die('skip laminas/laminas-code >= 3.5 must be installed');
15+
}
416
--FILE--
517
<?php
618

@@ -29,4 +41,4 @@ $factory
2941

3042
?>
3143
--EXPECT--
32-
Lazy Loaded!
44+
Lazy Loaded!

0 commit comments

Comments
 (0)