Skip to content

Commit 403f8aa

Browse files
committed
⬆️ update p-chess and phpunit
1 parent cde2528 commit 403f8aa

9 files changed

Lines changed: 35 additions & 37 deletions

File tree

.github/workflows/build.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: PHPStan
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414
- name: PHPStan
1515
uses: docker://oskarstark/phpstan-ga:1.8.0
1616
env:
@@ -22,9 +22,11 @@ jobs:
2222
name: PHP-CS-Fixer
2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626
- name: Fix CS
2727
uses: docker://oskarstark/php-cs-fixer-ga
28+
with:
29+
args: --diff --dry-run
2830
tests:
2931
runs-on: ubuntu-24.04
3032
strategy:
@@ -41,16 +43,16 @@ jobs:
4143
- description: 'Symfony 6.4'
4244
php: '8.3'
4345
symfony: 6.4.*
44-
- description: 'Symfony 7.2'
46+
- description: 'Symfony 7.3'
4547
php: '8.4'
46-
symfony: 7.2.*
48+
symfony: 7.3.*
4749
name: PHP ${{ matrix.php }} tests (${{ matrix.description }})
4850
steps:
4951
- name: Checkout
50-
uses: actions/checkout@v3
52+
uses: actions/checkout@v4
5153
- name: Cache
52-
uses: actions/cache@v3
53-
with:
54+
uses: actions/cache@v4
55+
with:
5456
path: ~/.composer/cache/files
5557
key: ${{ matrix.php }}-${{ matrix.symfony }}-${{ matrix.composer_option }}
5658
- name: Setup PHP

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020
],
2121
"require": {
2222
"php": "^8.1",
23-
"p-chess/chess": "^0.6",
23+
"p-chess/chess": "^0.7",
2424
"symfony/config": "^6.4 || ^7.0",
2525
"symfony/dependency-injection": "^6.4 || ^7.0",
2626
"symfony/http-kernel": "^6.4 || ^7.0",
2727
"symfony/routing": "^6.4 || ^7.0",
2828
"twig/twig": "^3.18"
2929
},
3030
"require-dev": {
31-
"dg/bypass-finals": "^1.6",
32-
"phpunit/phpunit": "^9.6",
33-
"symfony/phpunit-bridge": "^7.2"
31+
"dg/bypass-finals": "^1.9",
32+
"phpunit/phpunit": "^10.5 || ^11.5 || ^12.3",
33+
"symfony/phpunit-bridge": "^7.3"
3434
},
3535
"config": {
3636
"sort-packages": true

phpunit.xml.dist

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
33
colors="true"
4-
convertErrorsToExceptions="true"
5-
convertNoticesToExceptions="true"
6-
convertWarningsToExceptions="true"
74
beStrictAboutTestsThatDoNotTestAnything="true"
85
bootstrap="vendor/autoload.php"
96
>
@@ -13,14 +10,14 @@
1310
</testsuite>
1411
</testsuites>
1512

16-
<coverage>
13+
<source>
1714
<include>
1815
<directory>src</directory>
1916
</include>
20-
</coverage>
17+
</source>
2118

2219
<!-- see https://www.tomasvotruba.cz/blog/2019/03/28/how-to-mock-final-classes-in-phpunit/ -->
2320
<extensions>
24-
<extension class="PChess\ChessBundle\Tests\BypassFinalHook"/>
21+
<bootstrap class="PChess\ChessBundle\Tests\BypassFinalExtension"/>
2522
</extensions>
2623
</phpunit>

src/Twig/ChessExtension.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace PChess\ChessBundle\Twig;
44

5-
use PChess\ChessBundle\HtmlOutput;
65
use Twig\Extension\AbstractExtension;
76
use Twig\TwigFunction;
87

src/Twig/ChessRuntime.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use PChess\Chess\Chess;
66
use PChess\ChessBundle\HtmlOutput;
77
use Twig\Extension\AbstractExtension;
8-
use Twig\TwigFunction;
98

109
final class ChessRuntime extends AbstractExtension
1110
{

tests/BypassFinalExtension.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace PChess\ChessBundle\Tests;
4+
5+
use DG\BypassFinals;
6+
use PHPUnit\Runner\Extension\Extension;
7+
use PHPUnit\Runner\Extension\Facade;
8+
use PHPUnit\Runner\Extension\ParameterCollection;
9+
use PHPUnit\TextUI\Configuration\Configuration;
10+
11+
final class BypassFinalExtension implements Extension
12+
{
13+
public function bootstrap(Configuration $configuration, Facade $facade, ParameterCollection $parameters): void
14+
{
15+
BypassFinals::enable();
16+
}
17+
}

tests/BypassFinalHook.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/DependencyInjection/CompilerPassTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace PChess\ChessBundle\Tests\DependencyInjection;
44

55
use PChess\ChessBundle\DependencyInjection\CompilerPass;
6-
use PChess\ChessBundle\Twig\ChessRuntime;
76
use PHPUnit\Framework\TestCase;
87
use Symfony\Component\DependencyInjection\ContainerBuilder;
98
use Symfony\Component\DependencyInjection\Definition;
@@ -18,8 +17,7 @@ public function testProcess(): void
1817
/** @var ContainerBuilder&\PHPUnit\Framework\MockObject\MockObject $container */
1918
$container = $this->createMock(ContainerBuilder::class);
2019
$container->expects(self::once())->method('getParameter')->with('chess.output_service')->willReturn('foo');
21-
$container->expects(self::at(1))->method('getDefinition')->with('foo')->willReturn($definition);
22-
$container->expects(self::at(2))->method('getDefinition')->with(ChessRuntime::class)->willReturn($definition);
20+
$container->method('getDefinition')->willReturn($definition);
2321
$pass = new CompilerPass();
2422
$pass->process($container);
2523
}

tests/MoverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use PChess\Chess\Piece;
88
use PChess\ChessBundle\Mover;
99

10-
final class MoverTest extends \PHPUnit\Framework\TestCase
10+
final class MoverTest extends PHPUnit\Framework\TestCase
1111
{
1212
public function testGetAllowedMoves(): void
1313
{

0 commit comments

Comments
 (0)