|
36 | 36 | key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
37 | 37 | restore-keys: ${{ runner.os }}-composer- |
38 | 38 |
|
39 | | - - name: Update PHPUnit version for PHP 8 |
40 | | - id: composer-lock |
41 | | - if: "startsWith(matrix.php-version, '8.')" |
42 | | - run: | |
43 | | - rm -f composer.lock |
44 | | - echo "::set-output name=flags::--ignore-platform-reqs" |
45 | | - composer remove phpunit/phpunit --dev --no-update --no-interaction |
46 | | - composer require phpunit/phpunit ^8.0 --dev --no-update |
47 | | -
|
48 | 39 | - name: Install dependencies |
49 | | - run: composer update --no-progress --prefer-dist --optimize-autoloader ${{ steps.composer-lock.outputs.flags }} |
50 | | - |
51 | | - - name: Update code to make PHPUnit 8 compatible |
52 | | - if: "startsWith(matrix.php-version, '8.')" |
53 | | - run: | |
54 | | - find ./tests/ -name "*.php" -type f -exec sed -i -e 's/function setUpBeforeClass()$/function setUpBeforeClass(): void/' {} \; |
55 | | - find ./tests/ -name "*.php" -type f -exec sed -i -e 's/function tearDownAfterClass()$/function tearDownAfterClass(): void/' {} \; |
56 | | - find ./tests/ -name "*.php" -type f -exec sed -i -e 's/function setUp()$/function setUp(): void/' {} \; |
57 | | - find ./tests/ -name "*.php" -type f -exec sed -i -e 's/function tearDown()$/function tearDown(): void/' {} \; |
58 | | - find ./tests/ -name "*.php" -type f -exec sed -i -e 's/->assertContains(/->assertStringContainsString(/' {} \; |
59 | | - find ./tests/ -name "*.php" -type f -exec sed -i -e 's/->assertNotContains(/->assertStringNotContainsString(/' {} \; |
60 | | - find ./tests/ -name "*.php" -type f -exec sed -i -e "s/->assertInternalType('array', /->assertIsArray(/" {} \; |
61 | | - sed -i "s/\$this->addWarning('The @expectedException,/\/\/\$this->addWarning('The @expectedException,/" ./vendor/phpunit/phpunit/src/Framework/TestCase.php |
62 | | - sed -i "s/self::createWarning('The optional \$delta/\/\/self::createWarning('The optional \$delta/" ./vendor/phpunit/phpunit/src/Framework/Assert.php |
| 40 | + run: composer install --no-progress --prefer-dist --optimize-autoloader |
63 | 41 |
|
64 | 42 | - name: Setup problem matchers for PHP |
65 | 43 | run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
|
0 commit comments