chore: pint pass
This commit is contained in:
parent
a492e9823a
commit
06deb17236
6 changed files with 12 additions and 15 deletions
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Tests\Integration\Infra\Adapters\Repositories;
|
||||
|
||||
use Application\Security\Exceptions\ClientNotFoundException;
|
||||
use Application\Security\Models\Entities\Client;
|
||||
use Application\Security\Models\ValueObjects\ClientIdentifier;
|
||||
use Application\Security\Models\ValueObjects\ClientName;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Tests\Integration\Infra\Adapters\Repositories;
|
||||
|
||||
use Domain\Exceptions\BrandNotFoundException;
|
||||
use Domain\Models\Entities\Brand;
|
||||
use Domain\Models\ValueObjects\Brand\ArcadiaId;
|
||||
use Domain\Models\ValueObjects\Brand\BrandCode;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Tests\Unit\Infra\Adapters\Repositories;
|
||||
|
||||
use Domain\Exceptions\BrandNotFoundException;
|
||||
use Domain\Models\Entities\Brand;
|
||||
use Domain\Models\ValueObjects\Brand\ArcadiaId;
|
||||
use Domain\Models\ValueObjects\Brand\BrandCode;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Tests\Unit\Infra\Adapters\Repositories;
|
||||
|
||||
use Application\Security\Exceptions\ClientNotFoundException;
|
||||
use Application\Security\Models\Entities\Client;
|
||||
use Application\Security\Models\ValueObjects\ClientIdentifier;
|
||||
use Application\Security\Models\ValueObjects\ClientName;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ use Domain\Models\ValueObjects\Brand\BrandId;
|
|||
use Domain\Models\ValueObjects\Brand\BrandName;
|
||||
use Infra\Cache\BrandCache;
|
||||
use Mockery;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Psr\SimpleCache\CacheInterface;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
|
||||
|
|
@ -37,7 +38,7 @@ describe('BrandCache Unit Tests', function (): void {
|
|||
->andReturn($cacheData);
|
||||
|
||||
/** @var \Psr\Log\LoggerInterface&Mockery\MockInterface $loggerMock */
|
||||
$loggerMock = Mockery::mock(\Psr\Log\LoggerInterface::class);
|
||||
$loggerMock = Mockery::mock(LoggerInterface::class);
|
||||
$loggerMock->shouldReceive('warning')->zeroOrMoreTimes();
|
||||
$brandCache = new BrandCache($cacheMock, $loggerMock);
|
||||
|
||||
|
|
@ -73,7 +74,7 @@ describe('BrandCache Unit Tests', function (): void {
|
|||
->andReturn($cacheData);
|
||||
|
||||
/** @var \Psr\Log\LoggerInterface&Mockery\MockInterface $loggerMock */
|
||||
$loggerMock = Mockery::mock(\Psr\Log\LoggerInterface::class);
|
||||
$loggerMock = Mockery::mock(LoggerInterface::class);
|
||||
$loggerMock->shouldReceive('warning')->zeroOrMoreTimes();
|
||||
$brandCache = new BrandCache($cacheMock, $loggerMock);
|
||||
|
||||
|
|
@ -107,7 +108,7 @@ describe('BrandCache Unit Tests', function (): void {
|
|||
->andReturn($cacheData);
|
||||
|
||||
/** @var \Psr\Log\LoggerInterface&Mockery\MockInterface $loggerMock */
|
||||
$loggerMock = Mockery::mock(\Psr\Log\LoggerInterface::class);
|
||||
$loggerMock = Mockery::mock(LoggerInterface::class);
|
||||
$loggerMock->shouldReceive('warning')->zeroOrMoreTimes();
|
||||
$brandCache = new BrandCache($cacheMock, $loggerMock);
|
||||
|
||||
|
|
@ -133,7 +134,7 @@ describe('BrandCache Unit Tests', function (): void {
|
|||
->andReturn('corrupted_string');
|
||||
|
||||
/** @var \Psr\Log\LoggerInterface&Mockery\MockInterface $loggerMock */
|
||||
$loggerMock = Mockery::mock(\Psr\Log\LoggerInterface::class);
|
||||
$loggerMock = Mockery::mock(LoggerInterface::class);
|
||||
$loggerMock->shouldReceive('warning')->zeroOrMoreTimes();
|
||||
$brandCache = new BrandCache($cacheMock, $loggerMock);
|
||||
|
||||
|
|
@ -174,7 +175,7 @@ describe('BrandCache Unit Tests', function (): void {
|
|||
->with('brand:arcadia:20', $expectedData, 86400);
|
||||
|
||||
/** @var \Psr\Log\LoggerInterface&Mockery\MockInterface $loggerMock */
|
||||
$loggerMock = Mockery::mock(\Psr\Log\LoggerInterface::class);
|
||||
$loggerMock = Mockery::mock(LoggerInterface::class);
|
||||
$loggerMock->shouldReceive('warning')->zeroOrMoreTimes();
|
||||
$brandCache = new BrandCache($cacheMock, $loggerMock);
|
||||
|
||||
|
|
@ -211,7 +212,7 @@ describe('BrandCache Unit Tests', function (): void {
|
|||
->with('brand:arcadia:30');
|
||||
|
||||
/** @var \Psr\Log\LoggerInterface&Mockery\MockInterface $loggerMock */
|
||||
$loggerMock = Mockery::mock(\Psr\Log\LoggerInterface::class);
|
||||
$loggerMock = Mockery::mock(LoggerInterface::class);
|
||||
$loggerMock->shouldReceive('warning')->zeroOrMoreTimes();
|
||||
$brandCache = new BrandCache($cacheMock, $loggerMock);
|
||||
|
||||
|
|
@ -255,7 +256,7 @@ describe('BrandCache Unit Tests', function (): void {
|
|||
->with('brand:arcadia:1');
|
||||
|
||||
/** @var \Psr\Log\LoggerInterface&Mockery\MockInterface $loggerMock */
|
||||
$loggerMock = Mockery::mock(\Psr\Log\LoggerInterface::class);
|
||||
$loggerMock = Mockery::mock(LoggerInterface::class);
|
||||
$loggerMock->shouldReceive('warning')->zeroOrMoreTimes();
|
||||
$brandCache = new BrandCache($cacheMock, $loggerMock);
|
||||
|
||||
|
|
@ -273,7 +274,7 @@ describe('BrandCache Unit Tests', function (): void {
|
|||
$cacheMock->shouldReceive('get')->andThrow(new \RuntimeException('Redis error'));
|
||||
|
||||
/** @var \Psr\Log\LoggerInterface&\Mockery\MockInterface $loggerMock */
|
||||
$loggerMock = Mockery::mock(\Psr\Log\LoggerInterface::class);
|
||||
$loggerMock = Mockery::mock(LoggerInterface::class);
|
||||
$loggerMock->shouldReceive('warning')->once();
|
||||
|
||||
$brandCache = new BrandCache($cacheMock, $loggerMock);
|
||||
|
|
@ -298,7 +299,7 @@ describe('BrandCache Unit Tests', function (): void {
|
|||
$cacheMock->shouldReceive('set')->andThrow(new \RuntimeException('Redis error'));
|
||||
|
||||
/** @var \Psr\Log\LoggerInterface&\Mockery\MockInterface $loggerMock */
|
||||
$loggerMock = Mockery::mock(\Psr\Log\LoggerInterface::class);
|
||||
$loggerMock = Mockery::mock(LoggerInterface::class);
|
||||
$loggerMock->shouldReceive('warning')->once();
|
||||
|
||||
$brandCache = new BrandCache($cacheMock, $loggerMock);
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ describe('Pagination Value Object Unit Tests', function (): void {
|
|||
expect($pagination->from())->toBe($expectedFrom)
|
||||
->and($pagination->to())->toBe($expectedTo);
|
||||
})->with([
|
||||
'negative from is clamped to 0' => [-1, 10, 0, 10],
|
||||
'negative from is clamped to 0' => [-1, 10, 0, 10],
|
||||
'to below from+1 is clamped to from+1' => [10, 5, 10, 11],
|
||||
'to equal from is clamped to from+1' => [10, 10, 10, 11],
|
||||
'oversized range is clamped to max' => [0, 10001, 0, 10000],
|
||||
|
|
@ -100,7 +100,7 @@ describe('Pagination Value Object Unit Tests', function (): void {
|
|||
expect($pagination->pageNumber())->toBe($expectedPage)
|
||||
->and($pagination->pageSize())->toBe($expectedSize);
|
||||
})->with([
|
||||
'page 0 is clamped to 1' => [0, 10, 1, 10],
|
||||
'page 0 is clamped to 1' => [0, 10, 1, 10],
|
||||
'negative page clamped to 1' => [-1, 10, 1, 10],
|
||||
'size 0 is clamped to 1' => [1, 0, 1, 1],
|
||||
'negative size clamped to 1' => [1, -5, 1, 1],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue