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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tests:

.PHONY: infection
infection:
docker-compose run --rm php vendor/bin/infection
docker-compose run --rm php php -d memory_limit=512M vendor/bin/infection

.PHONY: psalm
psalm:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"symfony/yaml": "^8.0"
},
"require-dev": {
"phpunit/phpunit": "^11.0",
"phpunit/phpunit": "^13.0",
"friendsofphp/php-cs-fixer": "^3.80",
"vimeo/psalm": "^6.10",
"rector/rector": "^2.0",
Expand Down
111 changes: 0 additions & 111 deletions infection.log

This file was deleted.

2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd" bootstrap="vendor/autoload.php" cacheDirectory=".phpunit.cache" executionOrder="depends,defects" requireCoverageMetadata="false" beStrictAboutCoverageMetadata="false" beStrictAboutOutputDuringTests="false" failOnRisky="false" failOnWarning="false" colors="true" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" displayDetailsOnTestsThatTriggerDeprecations="true" displayDetailsOnTestsThatTriggerErrors="true" displayDetailsOnTestsThatTriggerNotices="true" displayDetailsOnTestsThatTriggerWarnings="true" displayDetailsOnPhpunitDeprecations="true" stopOnSkipped="false">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/13.0/phpunit.xsd" bootstrap="vendor/autoload.php" cacheDirectory=".phpunit.cache" executionOrder="depends,defects" requireCoverageMetadata="false" beStrictAboutCoverageMetadata="false" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" colors="true" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" displayDetailsOnTestsThatTriggerDeprecations="true" displayDetailsOnTestsThatTriggerErrors="true" displayDetailsOnTestsThatTriggerNotices="true" displayDetailsOnTestsThatTriggerWarnings="true" displayDetailsOnPhpunitDeprecations="true" stopOnSkipped="false">
<testsuites>
<testsuite name="default">
<directory suffix="Test.php">tests</directory>
Expand Down
26 changes: 13 additions & 13 deletions tests/Integration/Builder/OpenApiValidatorBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function use_custom_validator_pool(): void
public function use_custom_cache(): void
{
$yaml = "openapi: 3.0.3\ninfo:\n title: Test\n version: 1.0.0\npaths: []";
$cache = new SchemaCache($this->createMock(CacheItemPoolInterface::class));
$cache = new SchemaCache($this->createStub(CacheItemPoolInterface::class));

$builder = OpenApiValidatorBuilder::create()
->fromYamlString($yaml)
Expand Down Expand Up @@ -301,12 +301,12 @@ public function build_with_cache_enabled(): void
{
$yaml = "openapi: 3.0.3\ninfo:\n title: Test\n version: 1.0.0\npaths: []";

$cacheItem = $this->createMock(CacheItemInterface::class);
$cacheItem = $this->createStub(CacheItemInterface::class);
$cacheItem
->method('isHit')
->willReturn(false);

$pool = $this->createMock(CacheItemPoolInterface::class);
$pool = $this->createStub(CacheItemPoolInterface::class);
$pool
->method('getItem')
->willReturn($cacheItem);
Expand Down Expand Up @@ -417,12 +417,12 @@ public function build_preserves_all_configuration(): void
$formatter = new DetailedFormatter();
$logger = new class {};

$cacheItem = $this->createMock(CacheItemInterface::class);
$cacheItem = $this->createStub(CacheItemInterface::class);
$cacheItem
->method('isHit')
->willReturn(false);

$cachePool = $this->createMock(CacheItemPoolInterface::class);
$cachePool = $this->createStub(CacheItemPoolInterface::class);
$cachePool
->method('getItem')
->willReturn($cacheItem);
Expand Down Expand Up @@ -503,7 +503,7 @@ public function build_uses_cache_from_file(): void
$tempFile = sys_get_temp_dir() . '/test_cache.yaml';
file_put_contents($tempFile, "openapi: 3.0.3\ninfo:\n title: Cached\n version: 1.0.0\npaths: []");

$cacheItem = $this->createMock(CacheItemInterface::class);
$cacheItem = $this->createStub(CacheItemInterface::class);
$cacheItem
->method('isHit')
->willReturn(true);
Expand All @@ -514,7 +514,7 @@ public function build_uses_cache_from_file(): void
info: new InfoObject(title: 'From Cache', version: '1.0.0'),
));

$pool = $this->createMock(CacheItemPoolInterface::class);
$pool = $this->createStub(CacheItemPoolInterface::class);
$pool
->method('getItem')
->willReturn($cacheItem);
Expand All @@ -536,7 +536,7 @@ public function build_uses_cache_from_string(): void
{
$yaml = "openapi: 3.0.3\ninfo:\n title: Original\n version: 1.0.0\npaths: []";

$cacheItem = $this->createMock(CacheItemInterface::class);
$cacheItem = $this->createStub(CacheItemInterface::class);
$cacheItem
->method('isHit')
->willReturn(true);
Expand All @@ -547,7 +547,7 @@ public function build_uses_cache_from_string(): void
info: new InfoObject(title: 'From Cache', version: '1.0.0'),
));

$pool = $this->createMock(CacheItemPoolInterface::class);
$pool = $this->createStub(CacheItemPoolInterface::class);
$pool
->method('getItem')
->willReturn($cacheItem);
Expand All @@ -568,7 +568,7 @@ public function build_with_json_file_and_cache(): void
$tempFile = sys_get_temp_dir() . '/test_json_cache.json';
file_put_contents($tempFile, '{"openapi":"3.0.3","info":{"title":"JSON Cached","version":"1.0.0"},"paths":{}}');

$cacheItem = $this->createMock(CacheItemInterface::class);
$cacheItem = $this->createStub(CacheItemInterface::class);
$cacheItem
->method('isHit')
->willReturn(true);
Expand All @@ -579,7 +579,7 @@ public function build_with_json_file_and_cache(): void
info: new InfoObject(title: 'From JSON Cache', version: '1.0.0'),
));

$pool = $this->createMock(CacheItemPoolInterface::class);
$pool = $this->createStub(CacheItemPoolInterface::class);
$pool
->method('getItem')
->willReturn($cacheItem);
Expand All @@ -602,7 +602,7 @@ public function build_with_real_file_path_generates_cache_key(): void
$tempFile = sys_get_temp_dir() . '/test_realpath.yaml';
file_put_contents($tempFile, "openapi: 3.0.3\ninfo:\n title: Test\n version: 1.0.0\npaths: []");

$cacheItem = $this->createMock(CacheItemInterface::class);
$cacheItem = $this->createStub(CacheItemInterface::class);
$cacheItem
->method('isHit')
->willReturn(false);
Expand All @@ -613,7 +613,7 @@ public function build_with_real_file_path_generates_cache_key(): void
->method('expiresAfter')
->willReturnSelf();

$pool = $this->createMock(CacheItemPoolInterface::class);
$pool = $this->createStub(CacheItemPoolInterface::class);
$pool
->method('getItem')
->willReturn($cacheItem);
Expand Down
14 changes: 7 additions & 7 deletions tests/Integration/CacheIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function cache_hit_on_second_load(): void
$isHitFirstCall = false;
$isHitSecondCall = true;

$pool = $this->createMock(CacheItemPoolInterface::class);
$pool = $this->createStub(CacheItemPoolInterface::class);

$cacheItemMiss = $this->createCacheItem();
$cacheItemMiss
Expand Down Expand Up @@ -58,7 +58,7 @@ public function cache_hit_on_second_load(): void
#[Test]
public function cache_miss_on_first_load(): void
{
$pool = $this->createMock(CacheItemPoolInterface::class);
$pool = $this->createStub(CacheItemPoolInterface::class);

$cacheItem = $this->createCacheItem();
$cacheItem
Expand All @@ -83,7 +83,7 @@ public function cache_miss_on_first_load(): void
#[Test]
public function cache_with_custom_ttl(): void
{
$pool = $this->createMock(CacheItemPoolInterface::class);
$pool = $this->createStub(CacheItemPoolInterface::class);

$cacheItem = $this->createCacheItem();
$cacheItem
Expand All @@ -102,7 +102,7 @@ public function cache_with_custom_ttl(): void
#[Test]
public function cache_delete_works(): void
{
$pool = $this->createMock(CacheItemPoolInterface::class);
$pool = $this->createStub(CacheItemPoolInterface::class);

$pool
->method('deleteItem')
Expand All @@ -118,7 +118,7 @@ public function cache_delete_works(): void
#[Test]
public function cache_clear_works(): void
{
$pool = $this->createMock(CacheItemPoolInterface::class);
$pool = $this->createStub(CacheItemPoolInterface::class);

$pool
->method('clear')
Expand All @@ -134,7 +134,7 @@ public function cache_clear_works(): void
#[Test]
public function cache_has_works(): void
{
$pool = $this->createMock(CacheItemPoolInterface::class);
$pool = $this->createStub(CacheItemPoolInterface::class);

$pool
->method('hasItem')
Expand All @@ -147,7 +147,7 @@ public function cache_has_works(): void

private function createCacheItem(): CacheItemInterface
{
$item = $this->createMock(CacheItemInterface::class);
$item = $this->createStub(CacheItemInterface::class);
$item
->method('set')
->willReturnSelf();
Expand Down
6 changes: 3 additions & 3 deletions tests/Integration/EventIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ private function createPsr7Request(
array $headers = [],
string $body = '',
): object {
$request = $this->createMock(ServerRequestInterface::class);
$request = $this->createStub(ServerRequestInterface::class);

$request
->method('getMethod')
->willReturn($method);

$uriMock = $this->createMock(UriInterface::class);
$uriMock = $this->createStub(UriInterface::class);
$uriMock
->method('getPath')
->willReturn($uri);
Expand Down Expand Up @@ -198,7 +198,7 @@ private function createPsr7Request(
return '';
});

$stream = $this->createMock(StreamInterface::class);
$stream = $this->createStub(StreamInterface::class);
$stream
->method('__toString')
->willReturn($body);
Expand Down
10 changes: 5 additions & 5 deletions tests/Integration/Psr7IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ private function createPsr7Request(
array $headers = [],
string $body = '',
): object {
$request = $this->createMock(ServerRequestInterface::class);
$request = $this->createStub(ServerRequestInterface::class);

$request
->method('getMethod')
->willReturn($method);

$uriMock = $this->createMock(UriInterface::class);
$uriMock = $this->createStub(UriInterface::class);
$uriMock
->method('getPath')
->willReturn($uri);
Expand Down Expand Up @@ -144,7 +144,7 @@ private function createPsr7Request(
return '';
});

$stream = $this->createMock(StreamInterface::class);
$stream = $this->createStub(StreamInterface::class);
$stream
->method('__toString')
->willReturn($body);
Expand All @@ -161,7 +161,7 @@ private function createPsr7Response(
array $headers = [],
string $body = '',
): object {
$response = $this->createMock(ResponseInterface::class);
$response = $this->createStub(ResponseInterface::class);

$response
->method('getStatusCode')
Expand All @@ -175,7 +175,7 @@ private function createPsr7Response(
->method('getHeaderLine')
->willReturn('application/json');

$stream = $this->createMock(StreamInterface::class);
$stream = $this->createStub(StreamInterface::class);
$stream
->method('__toString')
->willReturn($body);
Expand Down
Loading
Loading