Skip to content

Commit 36d732d

Browse files
committed
update the ci to use php 8.1,
change the test so they use mikey179/vfsstream instead of adlawson/vfs
1 parent ea9fda4 commit 36d732d

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

.github/workflows/infection.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
- uses: actions/checkout@v2
88
- uses: shivammathur/setup-php@v2
99
with:
10-
php-version: '8.0'
10+
php-version: '8.1'
1111
tools: composer:v2
1212
coverage: pcov
1313
- uses: actions/cache@v2
@@ -19,12 +19,12 @@ jobs:
1919
- uses: php-actions/composer@v5
2020
with:
2121
args: --prefer-dist
22-
php_version: 8.0
22+
php_version: 8.1
2323

2424
- name: Infection
2525
run: |
26-
wget -q https://github.com/infection/infection/releases/download/0.20.0/infection.phar
27-
wget -q https://github.com/infection/infection/releases/download/0.20.0/infection.phar.asc
26+
wget -q https://github.com/infection/infection/releases/download/0.26.10/infection.phar
27+
wget -q https://github.com/infection/infection/releases/download/0.26.10/infection.phar.asc
2828
chmod +x infection.phar
2929
./infection.phar
3030

.github/workflows/phpstan-5.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
- uses: php-actions/composer@v5
1515
with:
1616
args: --prefer-dist
17-
php_version: 8.0
17+
php_version: 8.1
1818
- name: PHPStan
1919
uses: php-actions/phpstan@v2
2020
with:
2121
path: src/
22-
level: 5
23-
php_version: 8.0
22+
args: --level=5
23+
php_version: 8.1

.github/workflows/phpstan-7.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
- uses: php-actions/composer@v5
1515
with:
1616
args: --prefer-dist
17-
php_version: 8.0
17+
php_version: 8.1
1818
- name: PHPStan
1919
uses: php-actions/phpstan@v2
2020
with:
2121
path: src/
22-
level: 7
23-
php_version: 8.0
22+
args: --level=7
23+
php_version: 8.1

.github/workflows/phpstan-8.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
- uses: php-actions/composer@v5
1515
with:
1616
args: --prefer-dist
17-
php_version: 8.0
17+
php_version: 8.1
1818
- name: PHPStan
1919
uses: php-actions/phpstan@v2
2020
with:
2121
path: src/
22-
level: 8
23-
php_version: 8.0
22+
args: --level=8
23+
php_version: 8.1

.github/workflows/quality.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Quality (PHPStan level 4)
1+
name: Quality
22
on: push
33
jobs:
44
cs-fixer:
@@ -7,7 +7,7 @@ jobs:
77
- uses: actions/checkout@v2
88
- name: Cs-Fixer
99
run: |
10-
wget -q https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer
10+
wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer
1111
chmod a+x php-cs-fixer
1212
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run
1313
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v2
1818
- uses: shivammathur/setup-php@v2
1919
with:
20-
php-version: '8.0'
20+
php-version: '8.1'
2121
tools: composer:v2
2222
coverage: pcov
2323
- uses: actions/cache@v2
@@ -29,7 +29,7 @@ jobs:
2929
- uses: php-actions/composer@v5
3030
with:
3131
args: --prefer-dist
32-
php_version: 8.0
32+
php_version: 8.1
3333
- name: Run tests & generate Coverage
3434
run: bin/phpunit --configuration=phpunit.xml tests --coverage-html var/coverage --whitelist=src
3535
- name: Store coverage files
@@ -50,10 +50,11 @@ jobs:
5050
- uses: php-actions/composer@v5
5151
with:
5252
args: --prefer-dist
53-
php_version: 8.0
53+
php_version: 8.1
54+
5455
- name: PHPStan
5556
uses: php-actions/phpstan@v2
5657
with:
5758
path: src/
58-
level: 4
59-
php_version: 8.0
59+
args: --level=4
60+
php_version: 8.1

tests/functional/Constraint/Builder/BuilderProducesCodeThatTest.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,43 @@
33
namespace functional\Kiboko\Component\PHPUnitExtension\Constraint\Builder;
44

55
use Kiboko\Component\PHPUnitExtension\Constraint\Builder\BuilderProducesCodeThat;
6+
use org\bovigo\vfs\vfsStreamDirectory;
67
use PHPUnit\Framework\Constraint\IsFalse;
78
use PHPUnit\Framework\Constraint\IsTrue;
89
use PHPUnit\Framework\TestCase;
9-
use Vfs\FileSystem;
10+
use org\bovigo\vfs\vfsStream;
1011

1112
class BuilderProducesCodeThatTest extends TestCase
1213
{
13-
private ?FileSystem $fs = null;
14+
private ?vfsStreamDirectory $fs = null;
1415

1516
protected function setUp(): void
1617
{
17-
$this->fs = FileSystem::factory('vfs://');
18-
$this->fs->mount();
18+
$this->fs = vfsStream::setup();
1919
}
2020

2121
protected function tearDown(): void
2222
{
23-
$this->fs->unmount();
2423
$this->fs = null;
2524
}
2625

2726
public function testEvaluateReturnTrue(): void
2827
{
29-
$constraint = new BuilderProducesCodeThat(new IsTrue());
28+
$constraint = new BuilderProducesCodeThat($this->fs->url(), new IsTrue());
3029

3130
$this->assertTrue($constraint->evaluate(new BuilderStub(), returnResult: true));
3231
}
3332

3433
public function testEvaluateReturnFalse(): void
3534
{
36-
$constraint = new BuilderProducesCodeThat(new IsFalse());
35+
$constraint = new BuilderProducesCodeThat($this->fs->url(), new IsFalse());
3736

3837
$this->assertFalse($constraint->evaluate(new BuilderStub(), returnResult: true));
3938
}
4039

4140
public function testCountIsOne(): void
4241
{
43-
$constraint = new BuilderProducesCodeThat(new IsTrue());
42+
$constraint = new BuilderProducesCodeThat($this->fs->url(), new IsTrue());
4443

4544
$this->assertCount(1, $constraint);
4645
}

0 commit comments

Comments
 (0)