Skip to content

Commit 42e629c

Browse files
committed
fix: test 8.2
1 parent b66f793 commit 42e629c

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed

.github/workflows/build.yaml

+13-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-20.04
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
1313
- name: Setup PHP
1414
uses: shivammathur/setup-php@v2
1515
- name: Validate composer.json
@@ -19,7 +19,7 @@ jobs:
1919
name: PHP-CS-Fixer
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
2323
- name: Setup PHP
2424
uses: shivammathur/setup-php@v2
2525
with:
@@ -32,9 +32,15 @@ jobs:
3232
fail-fast: false
3333
matrix:
3434
include:
35+
- description: 'Symfony 6.3 DEV'
36+
php: '8.2'
37+
symfony: '6.3.*@dev'
38+
- description: 'Symfony 6.2'
39+
php: '8.2'
40+
symfony: '6.2.*'
3541
- description: 'Symfony 6.0'
36-
php: '8.0'
37-
symfony: '6.0.*@dev'
42+
php: '8.1'
43+
symfony: '6.0.*'
3844
- description: 'Symfony 5.0'
3945
php: '7.3'
4046
symfony: '5.0.*'
@@ -50,9 +56,9 @@ jobs:
5056
name: PHP ${{ matrix.php }} tests (${{ matrix.description }})
5157
steps:
5258
- name: Checkout
53-
uses: actions/checkout@v2
59+
uses: actions/checkout@v3
5460
- name: Cache
55-
uses: actions/cache@v2
61+
uses: actions/cache@v3
5662
with:
5763
path: ~/.composer/cache/files
5864
key: composer-${{ matrix.php }}-${{ matrix.symfony }}-${{ matrix.composer_option }}
@@ -68,7 +74,7 @@ jobs:
6874
composer config prefer-stable true
6975
if: matrix.beta
7076
- name: remove cs-fixer for Symfony 6
71-
if: contains(matrix.symfony, '6.0.*@dev')
77+
if: contains(matrix.symfony, '6.3.*@dev')
7278
run: |
7379
composer remove --dev friendsofphp/php-cs-fixer pedrotroller/php-cs-custom-fixer --no-update
7480
- run: composer update --prefer-dist --no-interaction --no-progress --ansi ${{ matrix.composer_option }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ vendor
44
bin
55
.php_cs.cache
66
.php-cs-fixer.cache
7+
.phpunit.result.cache
8+
.phpunit.cache

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
},
2323
"require-dev": {
2424
"phpunit/phpunit": "~7.4||~8.5",
25-
"phpstan/phpstan": "^0.12.7",
26-
"phpstan/phpstan-phpunit": "^0.12.6",
25+
"phpstan/phpstan": "^1.0.0",
26+
"phpstan/phpstan-phpunit": "^1.0.0",
2727
"friendsofphp/php-cs-fixer": "^2.16||^3.0",
2828
"pedrotroller/php-cs-custom-fixer": "^2.19"
2929
},

tests/Knp/Snappy/AbstractGeneratorTest.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Tests\Knp\Snappy;
44

55
use Knp\Snappy\AbstractGenerator;
6+
use Knp\Snappy\Exception\FileAlreadyExistsException;
67
use PHPUnit\Framework\TestCase;
78
use Psr\Log\LoggerInterface;
89
use InvalidArgumentException;
@@ -40,6 +41,7 @@ public function testAddOption(): void
4041
try {
4142
$r->invokeArgs($media, ['baz', 'bat']);
4243
$this->fail($message);
44+
// @phpstan-ignore-next-line
4345
} catch (InvalidArgumentException $e) {
4446
$this->anything();
4547
}
@@ -82,6 +84,7 @@ public function testAddOptions(): void
8284
try {
8385
$r->invokeArgs($media, [['bak' => 'bam', 'bah' => 'bap', 'baz' => 'bat']]);
8486
$this->fail($message);
87+
// @phpstan-ignore-next-line
8588
} catch (InvalidArgumentException $e) {
8689
$this->anything();
8790
}
@@ -542,6 +545,7 @@ public function testMergeOptions(): void
542545
try {
543546
$r->invokeArgs($media, [['foo' => 'ban', 'bad' => 'bah']]);
544547
$this->fail($message);
548+
// @phpstan-ignore-next-line
545549
} catch (InvalidArgumentException $e) {
546550
$this->anything();
547551
}
@@ -778,11 +782,10 @@ public function testIsAssociativeArray(array $array, bool $isAssociativeArray):
778782
$this->assertEquals($isAssociativeArray, $r->invokeArgs($generator, [$array]));
779783
}
780784

781-
/**
782-
* @expectedException Knp\Snappy\Exception\FileAlreadyExistsException
783-
*/
784785
public function testItThrowsTheProperExceptionWhenFileExistsAndNotOverwritting(): void
785786
{
787+
$this->expectException(FileAlreadyExistsException::class);
788+
786789
$media = $this->getMockBuilder(AbstractGenerator::class)
787790
->setMethods([
788791
'configure',

tests/Knp/Snappy/PdfTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public function testRemovesLocalFilesOnError(): void
8181
$this->assertEquals(1, \count($pdf->temporaryFiles));
8282
$this->expectException(Error::class);
8383
\trigger_error('test error', \E_USER_ERROR);
84+
// @phpstan-ignore-next-line See https://github.com/phpstan/phpstan/issues/7799
8485
$this->assertFileNotExists(\reset($pdf->temporaryFiles));
8586
}
8687

0 commit comments

Comments
 (0)