Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ jobs:
fail-fast: false
matrix:
php-version:
- 8.2
- 8.3
- 8.4
- 8.5
symfony-version:
- 6.4.*
- 7.4.*
- 8.0.*
dependencies: [lowest, highest]
name: 'PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }} + ${{ matrix.dependencies }} dependencies'

Expand Down
50 changes: 24 additions & 26 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,45 +14,43 @@
}
],
"require": {
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"php": "~8.4.0 || ~8.5.0",
"ext-dom": "*",
"ext-json": "*",
"azjezz/psl": "^2.9.1 || ^3.0.0 || ^4.0.0",
"coduo/php-matcher": "^6.0.15",
"dama/doctrine-test-bundle": "^7.3.0 || ^8.0.1",
"doctrine/data-fixtures": "^1.7.0 || ^2.0.0",
"doctrine/dbal": "^3.9.0 || ^4.0.2",
"doctrine/doctrine-fixtures-bundle": "^3.7.1 || ^4.0.0",
"doctrine/orm": "^2.20.0 || ^3.2.0",
"phpunit/phpunit": "^10.5 || ^11.5 || ^12.0",
"symfony/browser-kit": "^6.4 || ^7.2",
"symfony/css-selector": "^6.4 || ^7.2",
"symfony/dependency-injection": "^6.4 || ^7.2",
"symfony/framework-bundle": "^6.4 || ^7.2",
"symfony/polyfill-php83": "^1.31"
"azjezz/psl": "^3.3.0 || ^4.0.0",
"coduo/php-matcher": "^6.0.18",
"dama/doctrine-test-bundle": "^8.4",
"doctrine/data-fixtures": "^2.1.0",
"doctrine/dbal": "^3.10.0 || ^4.2.0",
"doctrine/doctrine-fixtures-bundle": "^3.7.3 || ^4.3.1",
"doctrine/orm": "^2.20.9 || ^3.5.0",
"phpunit/phpunit": "^12.4",
"symfony/browser-kit": "^6.4 || ^7.4 || ^8.0",
"symfony/css-selector": "^6.4 || ^7.4 || ^8.0",
"symfony/dependency-injection": "^6.4 || ^7.4 || ^8.0",
"symfony/framework-bundle": "^6.4 || ^7.4 || ^8.0"
},
"require-dev": {
"ext-imagick": "*",
"ext-intl": "*",
"doctrine/coding-standard": "^12.0.0",
"doctrine/coding-standard": "^14.0.0",
"ergebnis/composer-normalize": "^2.48.2",
"mikey179/vfsstream": "^1.6.12",
"moneyphp/money": "^4.7.1",
"nesbot/carbon": "^3.10.3",
"php-standard-library/phpstan-extension": "^2.0.1",
"moneyphp/money": "^4.8.0",
"nesbot/carbon": "^3.11.0",
"php-standard-library/phpstan-extension": "^2.0.2",
"phpstan/phpstan": "<=2.1.12",
"phpstan/phpstan-phpunit": "^2.0.6",
"phpstan/phpstan-strict-rules": "^2.0.6",
"phpstan/phpstan-symfony": "^2.0.4",
"spatie/pdf-to-image": "^3.1.0",
"spatie/pdf-to-text": "^1.54.1",
"squizlabs/php_codesniffer": "^3.13.4",
"symfony/clock": "^6.4 || ^7.2",
"symfony/console": "^6.4 || ^7.2",
"symfony/form": "^6.4 || ^7.2",
"symfony/security-core": "^6.4 || ^7.2",
"symfony/validator": "^6.4 || ^7.2",
"twig/twig": "^3.21.1"
"spatie/pdf-to-text": "^1.54.0",
"symfony/clock": "^6.4 || ^7.4 || ^8.0",
"symfony/console": "^6.4 || ^7.4 || ^8.0",
"symfony/form": "^6.4 || ^7.4 || ^8.0",
"symfony/security-core": "^6.4 || ^7.4 || ^8.0",
"symfony/validator": "^6.4 || ^7.4 || ^8.0",
"twig/twig": "^3.22.2"
},
"conflict": {
"spatie/pdf-to-image": "<3.0.0",
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
bootstrap="vendor/autoload.php"
failOnWarning="false"
failOnIncomplete="false"
displayDetailsOnPhpunitNotices="true"
cacheResult="false"
cacheDirectory=".phpunit.cache">
<testsuites>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ final class Speicher210FunctionalTestExtension extends ConfigurableExtension
*/
public function loadInternal(array $mergedConfig, ContainerBuilder $container): void
{
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.xml');
$loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.php');

$container
->getDefinition(TestStubCreateCommand::class)
Expand Down
13 changes: 13 additions & 0 deletions src/Resources/config/services.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

use Speicher210\FunctionalTestBundle\Command\TestStubCreateCommand;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $configurator): void {
$services = $configurator->services();

$services->set(TestStubCreateCommand::class)
->tag('console.command');
};
13 changes: 0 additions & 13 deletions src/Resources/config/services.xml

This file was deleted.

2 changes: 1 addition & 1 deletion src/SnapshotUpdater/Driver/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

final class Json implements Driver
{
public const DEFAULT_MATCHER_PATTERNS = [
public const array DEFAULT_MATCHER_PATTERNS = [
'@string@',
'@integer@',
'@number@',
Expand Down
14 changes: 7 additions & 7 deletions src/Test/Assert/Pdf/PdfToImageConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@

use Spatie\PdfToImage\Enums\OutputFormat;

final class PdfToImageConfiguration
final readonly class PdfToImageConfiguration
{
private const DEFAULT_OUTPUT_FORMAT = OutputFormat::Jpg;
private const DEFAULT_RESOLUTION = 144;
private const DEFAULT_COMPRESSION_QUALITY = 50;
private const OutputFormat DEFAULT_OUTPUT_FORMAT = OutputFormat::Jpg;
private const int DEFAULT_RESOLUTION = 144;
private const int DEFAULT_COMPRESSION_QUALITY = 50;

/**
* @param positive-int $resolution
* @param int<1,100> $compressionQuality
*/
private function __construct(
public readonly OutputFormat $outputFormat,
public readonly int $resolution,
public readonly int $compressionQuality,
public OutputFormat $outputFormat,
public int $resolution,
public int $compressionQuality,
) {
}

Expand Down
4 changes: 1 addition & 3 deletions src/Test/Doctrine/ORM/Query/AST/FunctionTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

use function method_exists;

use const PHP_VERSION_ID;

abstract class FunctionTestCase extends TestCase
{
/**
Expand All @@ -28,7 +26,7 @@ protected function getEntityManager(): EntityManager
$configuration->setProxyDir(__DIR__ . '/Fixtures/Proxies');
$configuration->setProxyNamespace(__NAMESPACE__ . '\Proxy');
$configuration->setAutoGenerateProxyClasses(true);
if (PHP_VERSION_ID >= 80400 && method_exists($configuration, 'enableNativeLazyObjects')) {
if (method_exists($configuration, 'enableNativeLazyObjects')) {
$configuration->enableNativeLazyObjects(true);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Test/RestControllerWebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
abstract class RestControllerWebTestCase extends WebTestCase
{
public const AUTHENTICATION_NONE = null;
public const null AUTHENTICATION_NONE = null;

/**
* The authenticated user for the test.
Expand Down
32 changes: 16 additions & 16 deletions src/Test/Symfony/Form/FormTypeTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected function createFormType(mixed $initialData = null): FormInterface
}

/**
* @param array<mixed> $submittedData
* @param array<string, mixed> $submittedData
*/
protected function assertFormSubmitOnGet(array $submittedData, mixed $expected, mixed $initialData = null): void
{
Expand All @@ -117,8 +117,8 @@ protected function assertFormSubmitOnGet(array $submittedData, mixed $expected,
}

/**
* @param array<mixed> $submittedData
* @param array<UploadedFile> $submittedFilesData
* @param array<string, mixed> $submittedData
* @param array<UploadedFile> $submittedFilesData
*/
protected function assertFormSubmitOnPost(array $submittedData, mixed $expected, mixed $initialData = null, array $submittedFilesData = []): void
{
Expand All @@ -127,8 +127,8 @@ protected function assertFormSubmitOnPost(array $submittedData, mixed $expected,
}

/**
* @param array<UploadedFile> $submittedFilesData
* @param array<mixed> $submittedData
* @param array<string, mixed> $submittedData
* @param array<UploadedFile> $submittedFilesData
*/
protected function assertFormSubmitOnPatch(array $submittedData, mixed $initialData, mixed $expected, array $submittedFilesData = []): void
{
Expand All @@ -137,35 +137,35 @@ protected function assertFormSubmitOnPatch(array $submittedData, mixed $initialD
}

/**
* @param array<mixed> $submittedData
* @param array<UploadedFile> $submittedFilesData
* @param array<string, mixed> $submittedData
* @param array<UploadedFile> $submittedFilesData
*/
protected function assertFormSubmitOnPostWithInvalidData(array $submittedData, mixed $initialData = null, array $submittedFilesData = []): void
{
$this->assertFormSubmitWithInvalidData($submittedData, Request::METHOD_POST, $initialData, $submittedFilesData);
}

/**
* @param array<mixed> $submittedData
* @param array<UploadedFile> $submittedFilesData
* @param array<string, mixed> $submittedData
* @param array<UploadedFile> $submittedFilesData
*/
protected function assertFormSubmitOnPatchWithInvalidData(array $submittedData, mixed $initialData, array $submittedFilesData = []): void
{
$this->assertFormSubmitWithInvalidData($submittedData, Request::METHOD_PATCH, $initialData, $submittedFilesData);
}

/**
* @param array<mixed> $submittedData
* @param array<string, mixed> $submittedData
*/
protected function assertFormSubmitOnGetWithInvalidData(array $submittedData): void
{
$this->assertFormSubmitWithInvalidData($submittedData, Request::METHOD_GET, null);
}

/**
* @param array<mixed> $submittedData
* @param Request::METHOD_* $method
* @param array<UploadedFile> $submittedFilesData
* @param array<string, mixed> $submittedData
* @param Request::METHOD_* $method
* @param array<UploadedFile> $submittedFilesData
*/
private function assertFormSubmitWithInvalidData(array $submittedData, string $method, mixed $initialData = null, array $submittedFilesData = []): void
{
Expand Down Expand Up @@ -194,9 +194,9 @@ private function assertFormSubmitWithInvalidData(array $submittedData, string $m
}

/**
* @param array<mixed> $submittedRequestData
* @param Request::METHOD_* $method
* @param array<UploadedFile> $submittedFilesData
* @param array<string, mixed> $submittedRequestData
* @param Request::METHOD_* $method
* @param array<UploadedFile> $submittedFilesData
*
* @return FormInterface<mixed>
*/
Expand Down
12 changes: 6 additions & 6 deletions src/Test/WebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@

abstract class WebTestCase extends KernelTestCase
{
protected const IMAGE_TYPE_BMP = 'bmp';
protected const IMAGE_TYPE_GIF = 'gif';
protected const IMAGE_TYPE_JPG = 'jpg';
protected const IMAGE_TYPE_PNG = 'png';
protected const IMAGE_TYPE_SVG = 'svg';
private const IMAGE_TYPES = [
protected const string IMAGE_TYPE_BMP = 'bmp';
protected const string IMAGE_TYPE_GIF = 'gif';
protected const string IMAGE_TYPE_JPG = 'jpg';
protected const string IMAGE_TYPE_PNG = 'png';
protected const string IMAGE_TYPE_SVG = 'svg';
private const array IMAGE_TYPES = [
self::IMAGE_TYPE_BMP,
self::IMAGE_TYPE_GIF,
self::IMAGE_TYPE_JPG,
Expand Down
16 changes: 8 additions & 8 deletions tests/Constraint/ResponseHeaderSameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ final class ResponseHeaderSameTest extends TestCase
{
public function testEvaluateReturnsNullForTheSameHeader(): void
{
$response = $this->createMock(Response::class);
$response = self::createStub(Response::class);
$headerBagMock = $this->createMock(ResponseHeaderBag::class);
$headerBagMock->expects(self::once())->method('get')->with('header-name')->willReturn('some_value');
$headerBagMock->expects($this->once())->method('get')->with('header-name')->willReturn('some_value');
$response->headers = $headerBagMock;

$constraint = new ResponseHeaderSame('header-name', 'some_value');
Expand All @@ -26,9 +26,9 @@ public function testEvaluateReturnsNullForTheSameHeader(): void

public function testEvaluateThrowsExceptionForDifferentHeader(): void
{
$response = $this->createMock(Response::class);
$response = self::createStub(Response::class);
$headerBagMock = $this->createMock(ResponseHeaderBag::class);
$headerBagMock->expects(self::exactly(2))->method('get')->with('header-name')->willReturn('some_value');
$headerBagMock->expects($this->exactly(2))->method('get')->with('header-name')->willReturn('some_value');
$response->headers = $headerBagMock;

$constraint = new ResponseHeaderSame('header-name', 'some_value1');
Expand All @@ -43,9 +43,9 @@ public function testEvaluateThrowsExceptionForDifferentHeader(): void

public function testEvaluateReturnsTrueForTheSameHeaderWithReturnResultSetToTrue(): void
{
$response = $this->createMock(Response::class);
$response = self::createStub(Response::class);
$headerBagMock = $this->createMock(ResponseHeaderBag::class);
$headerBagMock->expects(self::once())->method('get')->with('header-name')->willReturn('some_value');
$headerBagMock->expects($this->once())->method('get')->with('header-name')->willReturn('some_value');
$response->headers = $headerBagMock;

$constraint = new ResponseHeaderSame('header-name', 'some_value');
Expand All @@ -55,9 +55,9 @@ public function testEvaluateReturnsTrueForTheSameHeaderWithReturnResultSetToTrue

public function testEvaluateReturnsFalseForDifferentHeaderWithReturnResultSetToTrue(): void
{
$response = $this->createMock(Response::class);
$response = self::createStub(Response::class);
$headerBagMock = $this->createMock(ResponseHeaderBag::class);
$headerBagMock->expects(self::once())->method('get')->with('header-name')->willReturn('some_value');
$headerBagMock->expects($this->once())->method('get')->with('header-name')->willReturn('some_value');
$response->headers = $headerBagMock;

$constraint = new ResponseHeaderSame('header-name', 'some_value1');
Expand Down