Skip to content

Commit 74e6127

Browse files
committed
Drop PHP 7.1
1 parent dbe70f2 commit 74e6127

File tree

11 files changed

+64
-42
lines changed

11 files changed

+64
-42
lines changed

.github/workflows/coverage.yml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
php: ['8.2']
16+
php: ['8.4']
1717
setup: ['stable']
1818

1919
name: PHP
2020

2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v5
2323

2424
- name: Setup PHP
2525
uses: shivammathur/setup-php@v2
@@ -30,36 +30,39 @@ jobs:
3030

3131
- name: Cache Composer packages
3232
id: composer-cache
33-
uses: actions/cache@v2
33+
uses: actions/cache@v4
3434
with:
3535
path: vendor
3636
key: coverage-${{ matrix.php }}-${{ runner.os }}-${{ matrix.setup }}-${{ hashFiles('**/composer.lock') }}
3737
restore-keys: |
3838
coverage-${{ matrix.php }}-${{ runner.os }}-${{ matrix.setup }}-
3939
40-
- name: Code Climate Test Reporter Preparation
41-
run: |
42-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
43-
chmod +x ./cc-test-reporter
44-
./cc-test-reporter before-build
45-
env:
46-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
47-
4840
- name: Install dependencies
4941
if: steps.composer-cache.outputs.cache-hit != 'true'
5042
run: |
5143
${{ matrix.php >= 8 && 'composer require --no-update phpunit/phpunit:^9.6.12 --no-interaction;' || '' }}
5244
composer update --prefer-dist --no-interaction ${{ format('--prefer-{0}', matrix.setup) || '' }}
5345
5446
- name: Run test suite
55-
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml
56-
57-
- name: Code Climate Test Reporter
58-
if: ${{ env.CC_TEST_REPORTER_ID != '' }}
5947
run: |
48+
vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml
6049
cp coverage.xml clover.xml
61-
bash <(curl -s https://codecov.io/bash)
62-
./cc-test-reporter after-build --coverage-input-type clover --exit-code 0
50+
51+
- name: Code Climate Test Reporter
52+
uses: aktions/codeclimate-test-reporter@v1
53+
with:
54+
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
55+
command: after-build -t clover
56+
env:
57+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
58+
continue-on-error: true
59+
60+
- name: Upload coverage reports to Codecov
61+
uses: codecov/codecov-action@v5.5.1
62+
with:
63+
token: ${{ secrets.CODECOV_TOKEN }}
64+
65+
- name: Run Codacy Analysis CLI
66+
uses: codacy/codacy-analysis-cli-action@master
6367
env:
64-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
6568
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
16+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
1717
setup: ['lowest', 'stable']
1818

1919
name: PHP ${{ matrix.php }} - ${{ matrix.setup }}
2020

2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v5
2323

2424
- name: Setup PHP
2525
uses: shivammathur/setup-php@v2
@@ -30,7 +30,7 @@ jobs:
3030

3131
- name: Cache Composer packages
3232
id: composer-cache
33-
uses: actions/cache@v2
33+
uses: actions/cache@v4
3434
with:
3535
path: vendor
3636
key: php-${{ matrix.php }}-${{ runner.os }}-${{ matrix.setup }}-${{ hashFiles('**/composer.lock') }}

composer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,25 @@
1111
],
1212
"minimum-stability": "dev",
1313
"require": {
14-
"php": ">=7.1",
14+
"php": ">=7.2",
1515
"ext-json": "*",
1616
"composer/metadata-minifier": "^1.0",
1717
"composer/semver": "^1.0 || ^2.0 || ^3.0",
1818
"symfony/yaml": "^4.0 || ^5.0 || ^6.0 || ^7.0"
1919
},
2020
"require-dev": {
21-
"phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.12"
21+
"phpunit/phpunit": "^8.5.46 || ^9.6.27"
2222
},
2323
"autoload": {
2424
"psr-4": {
2525
"MultiTester\\": "./src/MultiTester"
2626
}
2727
},
28+
"autoload-dev": {
29+
"psr-4": {
30+
"MultiTester\\Tests\\": "./tests"
31+
}
32+
},
2833
"bin": ["bin/multi-tester"],
2934
"extra": {
3035
"branch-alias": {

tests/ArgumentsTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?php
22

3+
namespace MultiTester\Tests;
4+
35
use MultiTester\Arguments;
46
use MultiTester\MultiTesterException;
5-
use PHPUnit\Framework\TestCase;
67

78
class ArgumentsTest extends TestCase
89
{

tests/ConfigTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use MultiTester\Directory;
77
use MultiTester\MultiTester;
88
use MultiTester\MultiTesterException;
9-
use PHPUnit\Framework\TestCase;
109

1110
class ConfigTest extends TestCase
1211
{

tests/FileTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace MultiTester\Tests;
44

55
use MultiTester\File;
6-
use PHPUnit\Framework\TestCase;
76

87
class FileTest extends TestCase
98
{

tests/GitHubTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use MultiTester\GitHub;
88
use MultiTester\MultiTester;
99
use MultiTester\MultiTesterException;
10-
use PHPUnit\Framework\TestCase;
1110
use ReflectionMethod;
1211

1312
class GitHubTest extends TestCase

tests/MultiTesterTest.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ public function testRemoveDirectories(): void
178178

179179
$removeDirectories->invoke($tester, $directories);
180180

181-
$this->assertFileNotExists($directories[0]);
182-
$this->assertFileNotExists($directories[1]);
181+
$this->assertFileDoesNotExist($directories[0]);
182+
$this->assertFileDoesNotExist($directories[1]);
183183
}
184184

185185
/**
@@ -247,9 +247,12 @@ public function testGetComposerSettings(): void
247247

248248
$this->assertIsArray($package);
249249
$this->assertArrayHasKey('name', $package);
250-
$this->assertArrayHasKey('version', $package);
251250
$this->assertSame('pug-php/pug', $package['name']);
252-
$this->assertSame('3.2.0', $package['version']);
251+
$this->assertSame('3.2.0', $package['version'] ?? $package['number']);
252+
$this->assertSame(
253+
strtotime('2018-06-10T17:27:29.000Z'),
254+
strtotime($package['time'] ?? $package['published_at'])
255+
);
253256

254257
$this->assertNull($method->invoke($tester, 'pug-php/i-will-never-exist'));
255258
}
@@ -458,7 +461,7 @@ public function testError(): void
458461
$message = $exception->getMessage();
459462
}
460463

461-
$this->assertFileNotExists($directory);
464+
$this->assertFileDoesNotExist($directory);
462465
$this->assertSame('Fail', $message);
463466

464467
mkdir($directory, 0777, true);
@@ -470,7 +473,7 @@ public function testError(): void
470473
$message = $exception->getMessage();
471474
}
472475

473-
$this->assertFileNotExists($directory);
476+
$this->assertFileDoesNotExist($directory);
474477
$this->assertSame('Failure', $message);
475478
}
476479

tests/ProjectTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,10 @@ public function testSeedSourceSetting(): void
361361

362362
$this->assertIsArray($settings['source']);
363363
$this->assertSame('git', $settings['source']['type']);
364-
$this->assertSame('https://github.com/pug-php/pug.git', $settings['source']['url']);
364+
$this->assertContains($settings['source']['url'], [
365+
'https://github.com/pug-php/pug.git',
366+
'https://github.com/pug-php/pug',
367+
]);
365368

366369
$project = new Project('pug-php/does-not-exist', $config, []);
367370
$seedSourceSetting = new ReflectionMethod($project, 'seedSourceSetting');
@@ -844,7 +847,7 @@ public function testRemoveReplacedPackages(): void
844847
$removeReplacedPackages->setAccessible(true);
845848
$removeReplacedPackages->invoke($project);
846849

847-
$this->assertDirectoryNotExists($projectDir);
850+
$this->assertDirectoryDoesNotExist($projectDir);
848851

849852
chdir(sys_get_temp_dir());
850853
(new Directory($dir))->remove();

tests/SummaryTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace MultiTester\Tests;
44

55
use MultiTester\Summary;
6-
use PHPUnit\Framework\TestCase;
76

87
class SummaryTest extends TestCase
98
{

0 commit comments

Comments
 (0)