diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index c85cbf7..43a8795 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -33,8 +33,7 @@ jobs: - name: Install dependencies run: | - composer config allow-plugins.pestphp/pest-plugin true - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" pestphp/pest --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: Execute tests run: XDEBUG_MODE=coverage php vendor/bin/pest --coverage --min=100 diff --git a/composer.json b/composer.json index e5a0267..a662642 100644 --- a/composer.json +++ b/composer.json @@ -1,69 +1,71 @@ { - "name": "justbetter/laravel-akeneo-products", - "description": "Easily export products to Akeneo from your ERP", - "type": "package", - "license": "MIT", - "homepage": "https://github.com/justbetter/laravel-akeneo-products", - "authors": [ - { - "name": "Ramon Rietdijk", - "email": "ramon@justbetter.nl", - "role": "Developer" - }, - { - "name": "Vincent Boon", - "email": "vincent@justbetter.nl", - "role": "Developer" - } - ], - "require": { - "php": "^8.1", - "justbetter/laravel-akeneo-client": "^1.1", - "justbetter/laravel-error-logger": "^2.3", - "laravel/framework": "^10.0|^11.0", - "spatie/laravel-activitylog": "^4.7" - }, - "require-dev": { - "larastan/larastan": "^2.9", - "laravel/pint": "^1.10", - "orchestra/testbench": "^8.0|^9.0", - "phpstan/phpstan-mockery": "^1.1", - "phpunit/phpunit": "^10.1" - }, - "autoload": { - "psr-4": { - "JustBetter\\AkeneoProducts\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "JustBetter\\AkeneoProducts\\Tests\\": "tests" - } - }, - "scripts": { - "test": "phpunit", - "analyse": "phpstan", - "style": "pint --test", - "quality": [ - "@test", - "@analyse", - "@style" + "name": "justbetter/laravel-akeneo-products", + "description": "Easily export products to Akeneo from your ERP", + "type": "package", + "license": "MIT", + "homepage": "https://github.com/justbetter/laravel-akeneo-products", + "authors": [ + { + "name": "Ramon Rietdijk", + "email": "ramon@justbetter.nl", + "role": "Developer" + }, + { + "name": "Vincent Boon", + "email": "vincent@justbetter.nl", + "role": "Developer" + } ], - "fix-style": "pint" - }, - "config": { - "sort-packages": true, - "allow-plugins": { - "php-http/discovery": true - } - }, - "extra": { - "laravel": { - "providers": [ - "JustBetter\\AkeneoProducts\\ServiceProvider" - ] - } - }, - "minimum-stability": "dev", - "prefer-stable": true + "require": { + "php": "^8.1", + "justbetter/laravel-akeneo-client": "^1.1", + "justbetter/laravel-error-logger": "^2.3", + "laravel/framework": "^10.0|^11.0", + "spatie/laravel-activitylog": "^4.7" + }, + "require-dev": { + "larastan/larastan": "^2.9", + "laravel/pint": "^1.17", + "orchestra/testbench": "^8.0|^9.0", + "pestphp/pest": "^2.35", + "phpstan/phpstan-mockery": "^1.1", + "phpunit/phpunit": "^10.5" + }, + "autoload": { + "psr-4": { + "JustBetter\\AkeneoProducts\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "JustBetter\\AkeneoProducts\\Tests\\": "tests" + } + }, + "scripts": { + "test": "phpunit", + "analyse": "phpstan", + "style": "pint --test", + "quality": [ + "@test", + "@analyse", + "@style" + ], + "fix-style": "pint" + }, + "config": { + "sort-packages": true, + "allow-plugins": { + "php-http/discovery": true, + "pestphp/pest-plugin": true + } + }, + "extra": { + "laravel": { + "providers": [ + "JustBetter\\AkeneoProducts\\ServiceProvider" + ] + } + }, + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/phpstan.neon b/phpstan.neon index 75d23d6..53ccd28 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -7,5 +7,6 @@ parameters: - src - tests level: 8 - checkMissingIterableValueType: false - checkGenericClassInNonGenericObjectType: false + ignoreErrors: + - identifier: missingType.iterableValue + - identifier: missingType.generics diff --git a/phpunit.xml b/phpunit.xml index e73f4a6..2a96f18 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,5 +1,5 @@ - + ./tests/* diff --git a/src/Actions/Akeneo/CreateAttributeOption.php b/src/Actions/Akeneo/CreateAttributeOption.php index 472dc6b..05f0213 100644 --- a/src/Actions/Akeneo/CreateAttributeOption.php +++ b/src/Actions/Akeneo/CreateAttributeOption.php @@ -13,8 +13,7 @@ class CreateAttributeOption implements CreatesAttributeOptions public function __construct( protected Akeneo $akeneo, protected GetsAttributeOptions $getsAttributeOptions - ) { - } + ) {} public function create(string $code, string $optionCode, array $data): AttributeOptionData { diff --git a/src/Actions/Akeneo/FormatAttributeValues.php b/src/Actions/Akeneo/FormatAttributeValues.php index f67aafb..9d4e384 100644 --- a/src/Actions/Akeneo/FormatAttributeValues.php +++ b/src/Actions/Akeneo/FormatAttributeValues.php @@ -16,8 +16,7 @@ public function __construct( protected TypeFactory $typeFactory, protected GetsScopes $getsScopes, protected GetsLocales $getsLocales - ) { - } + ) {} public function format(string $attributeCode, mixed $value): array { diff --git a/src/Actions/Akeneo/GetAttribute.php b/src/Actions/Akeneo/GetAttribute.php index 8d5ad53..06783cd 100644 --- a/src/Actions/Akeneo/GetAttribute.php +++ b/src/Actions/Akeneo/GetAttribute.php @@ -11,8 +11,7 @@ class GetAttribute implements GetsAttributes { public function __construct( protected Akeneo $akeneo - ) { - } + ) {} public function get(string $code): AttributeData { diff --git a/src/Actions/Akeneo/GetAttributeOptions.php b/src/Actions/Akeneo/GetAttributeOptions.php index 211ddc4..9513513 100644 --- a/src/Actions/Akeneo/GetAttributeOptions.php +++ b/src/Actions/Akeneo/GetAttributeOptions.php @@ -13,8 +13,7 @@ class GetAttributeOptions implements GetsAttributeOptions { public function __construct( protected Akeneo $akeneo - ) { - } + ) {} public function get(string $code): Enumerable { diff --git a/src/Actions/Akeneo/GetLocales.php b/src/Actions/Akeneo/GetLocales.php index 98fec77..1f030a5 100644 --- a/src/Actions/Akeneo/GetLocales.php +++ b/src/Actions/Akeneo/GetLocales.php @@ -14,8 +14,7 @@ class GetLocales implements GetsLocales { public function __construct( protected Akeneo $akeneo - ) { - } + ) {} public function get(): Enumerable { @@ -23,7 +22,7 @@ public function get(): Enumerable $ttl = now()->addDay(); $locales = Cache::remember($key, $ttl, function (): array { - $search = new SearchBuilder(); + $search = new SearchBuilder; $search->addFilter('enabled', '=', true); $locales = []; diff --git a/src/Actions/Akeneo/GetScopes.php b/src/Actions/Akeneo/GetScopes.php index 1a5fc6c..ad99c82 100644 --- a/src/Actions/Akeneo/GetScopes.php +++ b/src/Actions/Akeneo/GetScopes.php @@ -13,8 +13,7 @@ class GetScopes implements GetsScopes { public function __construct( protected Akeneo $akeneo - ) { - } + ) {} public function get(): Enumerable { diff --git a/src/Actions/Akeneo/ResolveAttributeOption.php b/src/Actions/Akeneo/ResolveAttributeOption.php index 59e1f1d..330cb59 100644 --- a/src/Actions/Akeneo/ResolveAttributeOption.php +++ b/src/Actions/Akeneo/ResolveAttributeOption.php @@ -15,8 +15,7 @@ public function __construct( protected GetsAttributeOptions $getsAttributeOptions, protected GetsLocales $getsLocales, protected CreatesAttributeOptions $createsAttributeOptions - ) { - } + ) {} public function resolve(string $code, string $optionCode, string $label): AttributeOptionData { diff --git a/src/Actions/Product/UpdateProduct.php b/src/Actions/Product/UpdateProduct.php index 6967480..3b64b41 100644 --- a/src/Actions/Product/UpdateProduct.php +++ b/src/Actions/Product/UpdateProduct.php @@ -10,8 +10,7 @@ class UpdateProduct implements UpdatesProduct { public function __construct( protected Akeneo $akeneo - ) { - } + ) {} public function update(Product $product): void { @@ -19,6 +18,8 @@ public function update(Product $product): void $product->modified_at = now(); $product->update = false; + $product->fail_count = 0; + $product->failed_at = null; $product->save(); } diff --git a/src/Actions/ProductModel/UpdateProductModel.php b/src/Actions/ProductModel/UpdateProductModel.php index 7f87f6e..f37c6b4 100644 --- a/src/Actions/ProductModel/UpdateProductModel.php +++ b/src/Actions/ProductModel/UpdateProductModel.php @@ -10,8 +10,7 @@ class UpdateProductModel implements UpdatesProductModel { public function __construct( protected Akeneo $akeneo - ) { - } + ) {} public function update(ProductModel $productModel): void { @@ -23,6 +22,8 @@ public function update(ProductModel $productModel): void $productModel->modified_at = now(); $productModel->update = false; + $productModel->fail_count = 0; + $productModel->failed_at = null; $productModel->save(); } diff --git a/src/Akeneo/Types/BaseType.php b/src/Akeneo/Types/BaseType.php index 6cfdb55..eb87d81 100644 --- a/src/Akeneo/Types/BaseType.php +++ b/src/Akeneo/Types/BaseType.php @@ -13,8 +13,7 @@ abstract class BaseType public function __construct( protected Akeneo $akeneo - ) { - } + ) {} public function matches(string $type): bool { diff --git a/tests/Actions/Akeneo/CreateAttributeOptionTest.php b/tests/Actions/Akeneo/CreateAttributeOptionTest.php index 144a4d2..ad3e4a2 100644 --- a/tests/Actions/Akeneo/CreateAttributeOptionTest.php +++ b/tests/Actions/Akeneo/CreateAttributeOptionTest.php @@ -11,10 +11,11 @@ use JustBetter\AkeneoProducts\Data\AttributeOptionData; use JustBetter\AkeneoProducts\Tests\TestCase; use Mockery\MockInterface; +use PHPUnit\Framework\Attributes\Test; class CreateAttributeOptionTest extends TestCase { - /** @test */ + #[Test] public function it_can_create_attribute_options(): void { Akeneo::fake(); diff --git a/tests/Actions/Akeneo/FormatAttributeValuesTest.php b/tests/Actions/Akeneo/FormatAttributeValuesTest.php index e7cc96c..33a83f3 100644 --- a/tests/Actions/Akeneo/FormatAttributeValuesTest.php +++ b/tests/Actions/Akeneo/FormatAttributeValuesTest.php @@ -13,10 +13,11 @@ use JustBetter\AkeneoProducts\Data\ScopeData; use JustBetter\AkeneoProducts\Tests\TestCase; use Mockery\MockInterface; +use PHPUnit\Framework\Attributes\Test; class FormatAttributeValuesTest extends TestCase { - /** @test */ + #[Test] public function it_can_format_attribute_values_unscoped_unlocalized(): void { Akeneo::fake(); @@ -75,7 +76,7 @@ public function it_can_format_attribute_values_unscoped_unlocalized(): void ], $values); } - /** @test */ + #[Test] public function it_can_format_attribute_values_unscoped_localized(): void { Akeneo::fake(); @@ -134,7 +135,7 @@ public function it_can_format_attribute_values_unscoped_localized(): void ], $values); } - /** @test */ + #[Test] public function it_can_format_attribute_values_scoped_unlocalized(): void { Akeneo::fake(); @@ -193,7 +194,7 @@ public function it_can_format_attribute_values_scoped_unlocalized(): void ], $values); } - /** @test */ + #[Test] public function it_can_format_attribute_values_scoped_localized(): void { Akeneo::fake(); diff --git a/tests/Actions/Akeneo/GetAttributeOptionsTest.php b/tests/Actions/Akeneo/GetAttributeOptionsTest.php index 823f3bc..3d90f3c 100644 --- a/tests/Actions/Akeneo/GetAttributeOptionsTest.php +++ b/tests/Actions/Akeneo/GetAttributeOptionsTest.php @@ -6,10 +6,11 @@ use JustBetter\AkeneoClient\Client\Akeneo; use JustBetter\AkeneoProducts\Actions\Akeneo\GetAttributeOptions; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class GetAttributeOptionsTest extends TestCase { - /** @test */ + #[Test] public function it_can_attribute_options(): void { Akeneo::fake(); diff --git a/tests/Actions/Akeneo/GetAttributeTest.php b/tests/Actions/Akeneo/GetAttributeTest.php index 89a1367..8910450 100644 --- a/tests/Actions/Akeneo/GetAttributeTest.php +++ b/tests/Actions/Akeneo/GetAttributeTest.php @@ -6,10 +6,11 @@ use JustBetter\AkeneoClient\Client\Akeneo; use JustBetter\AkeneoProducts\Actions\Akeneo\GetAttribute; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class GetAttributeTest extends TestCase { - /** @test */ + #[Test] public function it_can_get_attributes(): void { Akeneo::fake(); diff --git a/tests/Actions/Akeneo/GetLocalesTest.php b/tests/Actions/Akeneo/GetLocalesTest.php index 9de0c5d..10f5c8f 100644 --- a/tests/Actions/Akeneo/GetLocalesTest.php +++ b/tests/Actions/Akeneo/GetLocalesTest.php @@ -6,10 +6,11 @@ use JustBetter\AkeneoClient\Client\Akeneo; use JustBetter\AkeneoProducts\Actions\Akeneo\GetLocales; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class GetLocalesTest extends TestCase { - /** @test */ + #[Test] public function it_can_get_locales(): void { Akeneo::fake(); diff --git a/tests/Actions/Akeneo/GetScopesTest.php b/tests/Actions/Akeneo/GetScopesTest.php index 39e4769..84d5e7e 100644 --- a/tests/Actions/Akeneo/GetScopesTest.php +++ b/tests/Actions/Akeneo/GetScopesTest.php @@ -6,10 +6,11 @@ use JustBetter\AkeneoClient\Client\Akeneo; use JustBetter\AkeneoProducts\Actions\Akeneo\GetScopes; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class GetScopesTest extends TestCase { - /** @test */ + #[Test] public function it_can_get_scopes(): void { Akeneo::fake(); diff --git a/tests/Actions/Akeneo/ResolveAttributeOptionTest.php b/tests/Actions/Akeneo/ResolveAttributeOptionTest.php index c25c044..f21882f 100644 --- a/tests/Actions/Akeneo/ResolveAttributeOptionTest.php +++ b/tests/Actions/Akeneo/ResolveAttributeOptionTest.php @@ -12,10 +12,11 @@ use JustBetter\AkeneoProducts\Data\LocaleData; use JustBetter\AkeneoProducts\Tests\TestCase; use Mockery\MockInterface; +use PHPUnit\Framework\Attributes\Test; class ResolveAttributeOptionTest extends TestCase { - /** @test */ + #[Test] public function it_can_resolve_attribute_options_using_code(): void { Akeneo::fake(); @@ -53,7 +54,7 @@ public function it_can_resolve_attribute_options_using_code(): void $this->assertEquals('optionCode', $data->code()); } - /** @test */ + #[Test] public function it_can_resolve_attribute_options_using_labels(): void { Akeneo::fake(); @@ -91,7 +92,7 @@ public function it_can_resolve_attribute_options_using_labels(): void $this->assertEquals('optionCode', $data->code()); } - /** @test */ + #[Test] public function it_can_resolve_attribute_options_by_creating_a_new_option(): void { Akeneo::fake(); diff --git a/tests/Actions/Product/ProcessProductsTest.php b/tests/Actions/Product/ProcessProductsTest.php index b6eca21..54b90d9 100644 --- a/tests/Actions/Product/ProcessProductsTest.php +++ b/tests/Actions/Product/ProcessProductsTest.php @@ -9,10 +9,11 @@ use JustBetter\AkeneoProducts\Models\Product; use JustBetter\AkeneoProducts\Tests\Fakes\Retrievers\Product\ProductRetriever; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class ProcessProductsTest extends TestCase { - /** @test */ + #[Test] public function it_can_process_products(): void { Bus::fake(); diff --git a/tests/Actions/Product/RetrieveProductTest.php b/tests/Actions/Product/RetrieveProductTest.php index 05d1a92..106e8de 100644 --- a/tests/Actions/Product/RetrieveProductTest.php +++ b/tests/Actions/Product/RetrieveProductTest.php @@ -7,10 +7,11 @@ use JustBetter\AkeneoProducts\Jobs\Product\SaveProductJob; use JustBetter\AkeneoProducts\Tests\Fakes\Retrievers\Product\ProductRetriever; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class RetrieveProductTest extends TestCase { - /** @test */ + #[Test] public function it_can_retrieve_products(): void { Bus::fake(); diff --git a/tests/Actions/Product/SaveProductTest.php b/tests/Actions/Product/SaveProductTest.php index d5947ae..2e77819 100644 --- a/tests/Actions/Product/SaveProductTest.php +++ b/tests/Actions/Product/SaveProductTest.php @@ -6,10 +6,11 @@ use JustBetter\AkeneoProducts\Data\ProductData; use JustBetter\AkeneoProducts\Models\Product; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class SaveProductTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_products(): void { $productData = ProductData::of([ diff --git a/tests/Actions/Product/UpdateProductTest.php b/tests/Actions/Product/UpdateProductTest.php index e56202a..59297f0 100644 --- a/tests/Actions/Product/UpdateProductTest.php +++ b/tests/Actions/Product/UpdateProductTest.php @@ -8,10 +8,11 @@ use JustBetter\AkeneoProducts\Actions\Product\UpdateProduct; use JustBetter\AkeneoProducts\Models\Product; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class UpdateProductTest extends TestCase { - /** @test */ + #[Test] public function it_can_update_products(): void { Akeneo::fake(); @@ -34,6 +35,8 @@ public function it_can_update_products(): void $product = Product::query()->create([ 'identifier' => 'identifier', 'data' => $payload, + 'fail_count' => 1, + 'failed_at' => now(), ]); /** @var UpdateProduct $action */ @@ -54,5 +57,7 @@ public function it_can_update_products(): void $this->assertNotNull($product->modified_at); $this->assertFalse($product->update); + $this->assertEquals(0, $product->fail_count); + $this->assertNull($product->failed_at); } } diff --git a/tests/Actions/ProductModel/ProcessProductModelsTest.php b/tests/Actions/ProductModel/ProcessProductModelsTest.php index 42f3aa8..993b531 100644 --- a/tests/Actions/ProductModel/ProcessProductModelsTest.php +++ b/tests/Actions/ProductModel/ProcessProductModelsTest.php @@ -9,10 +9,11 @@ use JustBetter\AkeneoProducts\Models\ProductModel; use JustBetter\AkeneoProducts\Tests\Fakes\Retrievers\ProductModel\ProductModelRetriever; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class ProcessProductModelsTest extends TestCase { - /** @test */ + #[Test] public function it_can_process_product_models(): void { Bus::fake(); diff --git a/tests/Actions/ProductModel/RetrieveProductModelTest.php b/tests/Actions/ProductModel/RetrieveProductModelTest.php index 9a96981..3cebc83 100644 --- a/tests/Actions/ProductModel/RetrieveProductModelTest.php +++ b/tests/Actions/ProductModel/RetrieveProductModelTest.php @@ -7,10 +7,11 @@ use JustBetter\AkeneoProducts\Jobs\ProductModel\SaveProductModelJob; use JustBetter\AkeneoProducts\Tests\Fakes\Retrievers\ProductModel\ProductModelRetriever; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class RetrieveProductModelTest extends TestCase { - /** @test */ + #[Test] public function it_can_retrieve_product_models(): void { Bus::fake(); diff --git a/tests/Actions/ProductModel/SaveProductModelTest.php b/tests/Actions/ProductModel/SaveProductModelTest.php index faa0125..04e0483 100644 --- a/tests/Actions/ProductModel/SaveProductModelTest.php +++ b/tests/Actions/ProductModel/SaveProductModelTest.php @@ -6,10 +6,11 @@ use JustBetter\AkeneoProducts\Data\ProductModelData; use JustBetter\AkeneoProducts\Models\ProductModel; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class SaveProductModelTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_product_models(): void { $productModelData = ProductModelData::of([ diff --git a/tests/Actions/ProductModel/UpdateProductModelTest.php b/tests/Actions/ProductModel/UpdateProductModelTest.php index 885c52f..5fcaba1 100644 --- a/tests/Actions/ProductModel/UpdateProductModelTest.php +++ b/tests/Actions/ProductModel/UpdateProductModelTest.php @@ -8,10 +8,11 @@ use JustBetter\AkeneoProducts\Actions\ProductModel\UpdateProductModel; use JustBetter\AkeneoProducts\Models\ProductModel; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class UpdateProductModelTest extends TestCase { - /** @test */ + #[Test] public function it_can_update_product_models(): void { Akeneo::fake(); @@ -34,6 +35,8 @@ public function it_can_update_product_models(): void $productModel = ProductModel::query()->create([ 'code' => 'code', 'data' => $payload, + 'fail_count' => 1, + 'failed_at' => now(), ]); /** @var UpdateProductModel $action */ @@ -54,5 +57,7 @@ public function it_can_update_product_models(): void $this->assertNotNull($productModel->modified_at); $this->assertFalse($productModel->update); + $this->assertEquals(0, $productModel->fail_count); + $this->assertNull($productModel->failed_at); } } diff --git a/tests/Akeneo/TypeFactoryTest.php b/tests/Akeneo/TypeFactoryTest.php index 9b21958..9c57f53 100644 --- a/tests/Akeneo/TypeFactoryTest.php +++ b/tests/Akeneo/TypeFactoryTest.php @@ -7,6 +7,7 @@ use JustBetter\AkeneoProducts\Akeneo\Types\SimpleType; use JustBetter\AkeneoProducts\Exceptions\InvalidTypeException; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class TypeFactoryTest extends TestCase { @@ -17,7 +18,7 @@ protected function setUp(): void Akeneo::fake(); } - /** @test */ + #[Test] public function it_can_match_types(): void { /** @var TypeFactory $factory */ @@ -28,7 +29,7 @@ public function it_can_match_types(): void $this->assertTrue($baseType instanceof SimpleType); } - /** @test */ + #[Test] public function it_can_throw_exceptions(): void { $this->expectException(InvalidTypeException::class); diff --git a/tests/Akeneo/Types/BooleanTypeTest.php b/tests/Akeneo/Types/BooleanTypeTest.php index ad6e492..f40f537 100644 --- a/tests/Akeneo/Types/BooleanTypeTest.php +++ b/tests/Akeneo/Types/BooleanTypeTest.php @@ -6,6 +6,8 @@ use JustBetter\AkeneoProducts\Akeneo\Types\BooleanType; use JustBetter\AkeneoProducts\Data\AttributeData; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; class BooleanTypeTest extends TestCase { @@ -16,7 +18,7 @@ protected function setUp(): void Akeneo::fake(); } - /** @test */ + #[Test] public function it_can_be_matched(): void { /** @var BooleanType $type */ @@ -27,11 +29,8 @@ public function it_can_be_matched(): void ); } - /** - * @test - * - * @dataProvider values - */ + #[Test] + #[DataProvider('values')] public function it_can_be_formatted(mixed $input, bool $output): void { /** @var BooleanType $type */ diff --git a/tests/Akeneo/Types/MetricTypeTest.php b/tests/Akeneo/Types/MetricTypeTest.php index c947915..d14f2bc 100644 --- a/tests/Akeneo/Types/MetricTypeTest.php +++ b/tests/Akeneo/Types/MetricTypeTest.php @@ -6,6 +6,8 @@ use JustBetter\AkeneoProducts\Akeneo\Types\MetricType; use JustBetter\AkeneoProducts\Data\AttributeData; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; class MetricTypeTest extends TestCase { @@ -16,7 +18,7 @@ protected function setUp(): void Akeneo::fake(); } - /** @test */ + #[Test] public function it_can_be_matched(): void { /** @var MetricType $type */ @@ -27,11 +29,8 @@ public function it_can_be_matched(): void ); } - /** - * @test - * - * @dataProvider values - */ + #[Test] + #[DataProvider('values')] public function it_can_be_formatted(mixed $input, array $output): void { /** @var MetricType $type */ diff --git a/tests/Akeneo/Types/NumberTypeTest.php b/tests/Akeneo/Types/NumberTypeTest.php index d0bab8e..03d6717 100644 --- a/tests/Akeneo/Types/NumberTypeTest.php +++ b/tests/Akeneo/Types/NumberTypeTest.php @@ -7,6 +7,8 @@ use JustBetter\AkeneoProducts\Data\AttributeData; use JustBetter\AkeneoProducts\Exceptions\InvalidValueException; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; class NumberTypeTest extends TestCase { @@ -17,7 +19,7 @@ protected function setUp(): void Akeneo::fake(); } - /** @test */ + #[Test] public function it_can_be_matched(): void { /** @var NumberType $type */ @@ -28,11 +30,8 @@ public function it_can_be_matched(): void ); } - /** - * @test - * - * @dataProvider decimalValues - */ + #[Test] + #[DataProvider('decimalValues')] public function it_can_be_formatted_with_decimals(mixed $input, mixed $output): void { /** @var NumberType $type */ @@ -74,11 +73,8 @@ public static function decimalValues(): array ]; } - /** - * @test - * - * @dataProvider integerValues - */ + #[Test] + #[DataProvider('integerValues')] public function it_can_be_formatted_with_integers(mixed $input, mixed $output): void { /** @var NumberType $type */ @@ -120,7 +116,7 @@ public static function integerValues(): array ]; } - /** @test */ + #[Test] public function it_can_throw_exceptions(): void { $this->expectException(InvalidValueException::class); diff --git a/tests/Akeneo/Types/PriceCollectionTypeTest.php b/tests/Akeneo/Types/PriceCollectionTypeTest.php index 270881e..c620fb6 100644 --- a/tests/Akeneo/Types/PriceCollectionTypeTest.php +++ b/tests/Akeneo/Types/PriceCollectionTypeTest.php @@ -7,6 +7,9 @@ use JustBetter\AkeneoProducts\Data\AttributeData; use JustBetter\AkeneoProducts\Exceptions\InvalidValueException; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; +use stdClass; class PriceCollectionTypeTest extends TestCase { @@ -17,7 +20,7 @@ protected function setUp(): void Akeneo::fake(); } - /** @test */ + #[Test] public function it_can_be_matched(): void { /** @var PriceCollectionType $type */ @@ -28,7 +31,7 @@ public function it_can_be_matched(): void ); } - /** @test */ + #[Test] public function it_throws_exception_for_invalid_type(): void { /** @var PriceCollectionType $type */ @@ -44,14 +47,11 @@ public function it_throws_exception_for_invalid_type(): void 'scopable' => false, ]); - $type->format($attributeData, new \stdClass()); + $type->format($attributeData, new stdClass); } - /** - * @test - * - * @dataProvider values - */ + #[Test] + #[DataProvider('values')] public function it_can_be_formatted(mixed $input, mixed $output): void { /** @var PriceCollectionType $type */ diff --git a/tests/Akeneo/Types/SimpleSelectTypeTest.php b/tests/Akeneo/Types/SimpleSelectTypeTest.php index 9379d9d..5ade9af 100644 --- a/tests/Akeneo/Types/SimpleSelectTypeTest.php +++ b/tests/Akeneo/Types/SimpleSelectTypeTest.php @@ -9,6 +9,8 @@ use JustBetter\AkeneoProducts\Data\AttributeOptionData; use JustBetter\AkeneoProducts\Tests\TestCase; use Mockery\MockInterface; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; class SimpleSelectTypeTest extends TestCase { @@ -19,7 +21,7 @@ protected function setUp(): void Akeneo::fake(); } - /** @test */ + #[Test] public function it_can_be_matched(): void { /** @var SimpleSelectType $type */ @@ -30,11 +32,8 @@ public function it_can_be_matched(): void ); } - /** - * @test - * - * @dataProvider values - */ + #[Test] + #[DataProvider('values')] public function it_can_be_formatted(mixed $input, mixed $output): void { $this->mock(ResolvesAttributeOptions::class, function (MockInterface $mock): void { diff --git a/tests/Akeneo/Types/SimpleTypeTest.php b/tests/Akeneo/Types/SimpleTypeTest.php index c386a55..c139778 100644 --- a/tests/Akeneo/Types/SimpleTypeTest.php +++ b/tests/Akeneo/Types/SimpleTypeTest.php @@ -6,6 +6,8 @@ use JustBetter\AkeneoProducts\Akeneo\Types\SimpleType; use JustBetter\AkeneoProducts\Data\AttributeData; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; class SimpleTypeTest extends TestCase { @@ -16,7 +18,7 @@ protected function setUp(): void Akeneo::fake(); } - /** @test */ + #[Test] public function it_can_be_matched(): void { /** @var SimpleType $type */ @@ -27,11 +29,8 @@ public function it_can_be_matched(): void ); } - /** - * @test - * - * @dataProvider values - */ + #[Test] + #[DataProvider('values')] public function it_can_be_formatted(mixed $input, mixed $output): void { /** @var SimpleType $type */ diff --git a/tests/Commands/Product/ProcessProductsCommandTest.php b/tests/Commands/Product/ProcessProductsCommandTest.php index dfad7ce..3342811 100644 --- a/tests/Commands/Product/ProcessProductsCommandTest.php +++ b/tests/Commands/Product/ProcessProductsCommandTest.php @@ -7,10 +7,11 @@ use JustBetter\AkeneoProducts\Commands\Product\ProcessProductsCommand; use JustBetter\AkeneoProducts\Jobs\Product\ProcessProductsJob; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class ProcessProductsCommandTest extends TestCase { - /** @test */ + #[Test] public function it_can_dispatch_jobs(): void { Bus::fake(); diff --git a/tests/Commands/Product/RetrieveProductCommandTest.php b/tests/Commands/Product/RetrieveProductCommandTest.php index a68a684..421f79b 100644 --- a/tests/Commands/Product/RetrieveProductCommandTest.php +++ b/tests/Commands/Product/RetrieveProductCommandTest.php @@ -7,10 +7,11 @@ use JustBetter\AkeneoProducts\Commands\Product\RetrieveProductCommand; use JustBetter\AkeneoProducts\Jobs\Product\RetrieveProductJob; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class RetrieveProductCommandTest extends TestCase { - /** @test */ + #[Test] public function it_can_dispatch_jobs(): void { Bus::fake(); diff --git a/tests/Commands/Product/UpdateProductCommandTest.php b/tests/Commands/Product/UpdateProductCommandTest.php index 0920804..8b096e5 100644 --- a/tests/Commands/Product/UpdateProductCommandTest.php +++ b/tests/Commands/Product/UpdateProductCommandTest.php @@ -8,10 +8,11 @@ use JustBetter\AkeneoProducts\Jobs\Product\UpdateProductJob; use JustBetter\AkeneoProducts\Models\Product; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class UpdateProductCommandTest extends TestCase { - /** @test */ + #[Test] public function it_can_dispatch_jobs(): void { Bus::fake(); diff --git a/tests/Commands/ProductModel/ProcessProductModelsCommandTest.php b/tests/Commands/ProductModel/ProcessProductModelsCommandTest.php index 07be060..e113316 100644 --- a/tests/Commands/ProductModel/ProcessProductModelsCommandTest.php +++ b/tests/Commands/ProductModel/ProcessProductModelsCommandTest.php @@ -7,10 +7,11 @@ use JustBetter\AkeneoProducts\Commands\ProductModel\ProcessProductModelsCommand; use JustBetter\AkeneoProducts\Jobs\ProductModel\ProcessProductModelsJob; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class ProcessProductModelsCommandTest extends TestCase { - /** @test */ + #[Test] public function it_can_dispatch_jobs(): void { Bus::fake(); diff --git a/tests/Commands/ProductModel/RetrieveProductModelCommandTest.php b/tests/Commands/ProductModel/RetrieveProductModelCommandTest.php index c0e9ce3..43ec863 100644 --- a/tests/Commands/ProductModel/RetrieveProductModelCommandTest.php +++ b/tests/Commands/ProductModel/RetrieveProductModelCommandTest.php @@ -7,10 +7,11 @@ use JustBetter\AkeneoProducts\Commands\ProductModel\RetrieveProductModelCommand; use JustBetter\AkeneoProducts\Jobs\ProductModel\RetrieveProductModelJob; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class RetrieveProductModelCommandTest extends TestCase { - /** @test */ + #[Test] public function it_can_dispatch_jobs(): void { Bus::fake(); diff --git a/tests/Commands/ProductModel/UpdateProductModelCommandTest.php b/tests/Commands/ProductModel/UpdateProductModelCommandTest.php index f23300b..eb41acd 100644 --- a/tests/Commands/ProductModel/UpdateProductModelCommandTest.php +++ b/tests/Commands/ProductModel/UpdateProductModelCommandTest.php @@ -8,10 +8,11 @@ use JustBetter\AkeneoProducts\Jobs\ProductModel\UpdateProductModelJob; use JustBetter\AkeneoProducts\Models\ProductModel; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class UpdateProductModelCommandTest extends TestCase { - /** @test */ + #[Test] public function it_can_dispatch_jobs(): void { Bus::fake(); diff --git a/tests/Data/AttributeDataTest.php b/tests/Data/AttributeDataTest.php index da26c30..ad839eb 100644 --- a/tests/Data/AttributeDataTest.php +++ b/tests/Data/AttributeDataTest.php @@ -4,10 +4,11 @@ use JustBetter\AkeneoProducts\Data\AttributeData; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class AttributeDataTest extends TestCase { - /** @test */ + #[Test] public function it_can_interact_with_attribute_data(): void { $attributeData = AttributeData::of([ diff --git a/tests/Data/AttributeOptionDataTest.php b/tests/Data/AttributeOptionDataTest.php index 6e1ef73..3fe179f 100644 --- a/tests/Data/AttributeOptionDataTest.php +++ b/tests/Data/AttributeOptionDataTest.php @@ -4,10 +4,11 @@ use JustBetter\AkeneoProducts\Data\AttributeOptionData; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class AttributeOptionDataTest extends TestCase { - /** @test */ + #[Test] public function it_can_interact_with_attribute_option_data(): void { $attributeOptionData = AttributeOptionData::of([ diff --git a/tests/Data/DataTest.php b/tests/Data/DataTest.php index ceca439..3cd2710 100644 --- a/tests/Data/DataTest.php +++ b/tests/Data/DataTest.php @@ -5,10 +5,11 @@ use Illuminate\Validation\ValidationException; use JustBetter\AkeneoProducts\Data\ProductData; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class DataTest extends TestCase { - /** @test */ + #[Test] public function it_can_interact_with_data(): void { $productData = ProductData::of([ @@ -36,12 +37,11 @@ public function it_can_interact_with_data(): void $this->assertNull($productData['identifier']); } + #[Test] public function it_can_throw_exceptions(): void { $this->expectException(ValidationException::class); - ProductData::of([ - 'identifier' => 'identifier', - ]); + ProductData::of([]); } } diff --git a/tests/Data/LocaleDataTest.php b/tests/Data/LocaleDataTest.php index d4718fe..f4eb08f 100644 --- a/tests/Data/LocaleDataTest.php +++ b/tests/Data/LocaleDataTest.php @@ -4,10 +4,11 @@ use JustBetter\AkeneoProducts\Data\LocaleData; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class LocaleDataTest extends TestCase { - /** @test */ + #[Test] public function it_can_interact_with_locale_data(): void { $localeData = LocaleData::of([ diff --git a/tests/Data/ProductDataTest.php b/tests/Data/ProductDataTest.php index 3407441..36095ca 100644 --- a/tests/Data/ProductDataTest.php +++ b/tests/Data/ProductDataTest.php @@ -4,10 +4,11 @@ use JustBetter\AkeneoProducts\Data\ProductData; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class ProductDataTest extends TestCase { - /** @test */ + #[Test] public function it_can_interact_with_product_data(): void { $productData = ProductData::of([ diff --git a/tests/Data/ProductModelDataTest.php b/tests/Data/ProductModelDataTest.php index d1694b9..25cb727 100644 --- a/tests/Data/ProductModelDataTest.php +++ b/tests/Data/ProductModelDataTest.php @@ -4,10 +4,11 @@ use JustBetter\AkeneoProducts\Data\ProductModelData; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class ProductModelDataTest extends TestCase { - /** @test */ + #[Test] public function it_can_interact_with_product_model_data(): void { $productModelData = ProductModelData::of([ diff --git a/tests/Data/ScopeDataTest.php b/tests/Data/ScopeDataTest.php index 50c8aa9..2982e6e 100644 --- a/tests/Data/ScopeDataTest.php +++ b/tests/Data/ScopeDataTest.php @@ -4,10 +4,11 @@ use JustBetter\AkeneoProducts\Data\ScopeData; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class ScopeDataTest extends TestCase { - /** @test */ + #[Test] public function it_can_interact_with_scope_data(): void { $scopeData = ScopeData::of([ diff --git a/tests/Jobs/Product/ProcessProductsJobTest.php b/tests/Jobs/Product/ProcessProductsJobTest.php index e9326c2..b1be00e 100644 --- a/tests/Jobs/Product/ProcessProductsJobTest.php +++ b/tests/Jobs/Product/ProcessProductsJobTest.php @@ -6,10 +6,11 @@ use JustBetter\AkeneoProducts\Jobs\Product\ProcessProductsJob; use JustBetter\AkeneoProducts\Tests\TestCase; use Mockery\MockInterface; +use PHPUnit\Framework\Attributes\Test; class ProcessProductsJobTest extends TestCase { - /** @test */ + #[Test] public function it_can_process_products(): void { $this->mock(ProcessesProducts::class, function (MockInterface $mock): void { diff --git a/tests/Jobs/Product/RetrieveProductJobTest.php b/tests/Jobs/Product/RetrieveProductJobTest.php index 60058ac..c194337 100644 --- a/tests/Jobs/Product/RetrieveProductJobTest.php +++ b/tests/Jobs/Product/RetrieveProductJobTest.php @@ -6,10 +6,11 @@ use JustBetter\AkeneoProducts\Jobs\Product\RetrieveProductJob; use JustBetter\AkeneoProducts\Tests\TestCase; use Mockery\MockInterface; +use PHPUnit\Framework\Attributes\Test; class RetrieveProductJobTest extends TestCase { - /** @test */ + #[Test] public function it_can_retrieve_products(): void { $this->mock(RetrievesProduct::class, function (MockInterface $mock): void { @@ -23,7 +24,7 @@ public function it_can_retrieve_products(): void RetrieveProductJob::dispatch('identifier'); } - /** @test */ + #[Test] public function it_has_correct_tags_and_unique_id(): void { $job = new RetrieveProductJob('identifier'); diff --git a/tests/Jobs/Product/SaveProductJobTest.php b/tests/Jobs/Product/SaveProductJobTest.php index 9e61072..f38bfbc 100644 --- a/tests/Jobs/Product/SaveProductJobTest.php +++ b/tests/Jobs/Product/SaveProductJobTest.php @@ -7,10 +7,11 @@ use JustBetter\AkeneoProducts\Jobs\Product\SaveProductJob; use JustBetter\AkeneoProducts\Tests\TestCase; use Mockery\MockInterface; +use PHPUnit\Framework\Attributes\Test; class SaveProductJobTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_products(): void { $productData = ProductData::of([ @@ -36,7 +37,7 @@ public function it_can_save_products(): void SaveProductJob::dispatch($productData); } - /** @test */ + #[Test] public function it_has_correct_tags_and_unique_id(): void { $productData = ProductData::of([ diff --git a/tests/Jobs/Product/UpdateProductJobTest.php b/tests/Jobs/Product/UpdateProductJobTest.php index 7927e9a..aa684aa 100644 --- a/tests/Jobs/Product/UpdateProductJobTest.php +++ b/tests/Jobs/Product/UpdateProductJobTest.php @@ -8,10 +8,11 @@ use JustBetter\AkeneoProducts\Models\Product; use JustBetter\AkeneoProducts\Tests\TestCase; use Mockery\MockInterface; +use PHPUnit\Framework\Attributes\Test; class UpdateProductJobTest extends TestCase { - /** @test */ + #[Test] public function it_can_update_products(): void { /** @var Product $product */ @@ -30,7 +31,7 @@ public function it_can_update_products(): void UpdateProductJob::dispatch($product); } - /** @test */ + #[Test] public function it_can_fail(): void { /** @var Product $product */ @@ -45,7 +46,7 @@ public function it_can_fail(): void $this->assertNotNull($product->failed_at); } - /** @test */ + #[Test] public function it_has_correct_tags_and_unique_id(): void { /** @var Product $product */ diff --git a/tests/Jobs/ProductModel/ProcessProductModelsJobTest.php b/tests/Jobs/ProductModel/ProcessProductModelsJobTest.php index 18e9dfc..a15ba22 100644 --- a/tests/Jobs/ProductModel/ProcessProductModelsJobTest.php +++ b/tests/Jobs/ProductModel/ProcessProductModelsJobTest.php @@ -6,10 +6,11 @@ use JustBetter\AkeneoProducts\Jobs\ProductModel\ProcessProductModelsJob; use JustBetter\AkeneoProducts\Tests\TestCase; use Mockery\MockInterface; +use PHPUnit\Framework\Attributes\Test; class ProcessProductModelsJobTest extends TestCase { - /** @test */ + #[Test] public function it_can_process_product_models(): void { $this->mock(ProcessesProductModels::class, function (MockInterface $mock): void { diff --git a/tests/Jobs/ProductModel/RetrieveProductModelJobTest.php b/tests/Jobs/ProductModel/RetrieveProductModelJobTest.php index e44d877..9e58588 100644 --- a/tests/Jobs/ProductModel/RetrieveProductModelJobTest.php +++ b/tests/Jobs/ProductModel/RetrieveProductModelJobTest.php @@ -6,10 +6,11 @@ use JustBetter\AkeneoProducts\Jobs\ProductModel\RetrieveProductModelJob; use JustBetter\AkeneoProducts\Tests\TestCase; use Mockery\MockInterface; +use PHPUnit\Framework\Attributes\Test; class RetrieveProductModelJobTest extends TestCase { - /** @test */ + #[Test] public function it_can_retrieve_product_models(): void { $this->mock(RetrievesProductModel::class, function (MockInterface $mock): void { @@ -23,7 +24,7 @@ public function it_can_retrieve_product_models(): void RetrieveProductModelJob::dispatch('code'); } - /** @test */ + #[Test] public function it_has_correct_tags_and_unique_id(): void { $job = new RetrieveProductModelJob('code'); diff --git a/tests/Jobs/ProductModel/SaveProductModelJobTest.php b/tests/Jobs/ProductModel/SaveProductModelJobTest.php index 20ae5a3..a462629 100644 --- a/tests/Jobs/ProductModel/SaveProductModelJobTest.php +++ b/tests/Jobs/ProductModel/SaveProductModelJobTest.php @@ -7,10 +7,11 @@ use JustBetter\AkeneoProducts\Jobs\ProductModel\SaveProductModelJob; use JustBetter\AkeneoProducts\Tests\TestCase; use Mockery\MockInterface; +use PHPUnit\Framework\Attributes\Test; class SaveProductModelJobTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_product_models(): void { $productModelData = ProductModelData::of([ @@ -36,7 +37,7 @@ public function it_can_save_product_models(): void SaveProductModelJob::dispatch($productModelData); } - /** @test */ + #[Test] public function it_has_correct_tags_and_unique_id(): void { $productModelData = ProductModelData::of([ diff --git a/tests/Jobs/ProductModel/UpdateProductModelJobTest.php b/tests/Jobs/ProductModel/UpdateProductModelJobTest.php index a88ec5b..a7bbb97 100644 --- a/tests/Jobs/ProductModel/UpdateProductModelJobTest.php +++ b/tests/Jobs/ProductModel/UpdateProductModelJobTest.php @@ -8,10 +8,11 @@ use JustBetter\AkeneoProducts\Models\ProductModel; use JustBetter\AkeneoProducts\Tests\TestCase; use Mockery\MockInterface; +use PHPUnit\Framework\Attributes\Test; class UpdateProductModelJobTest extends TestCase { - /** @test */ + #[Test] public function it_can_update_product_models(): void { /** @var ProductModel $productModel */ @@ -30,7 +31,7 @@ public function it_can_update_product_models(): void UpdateProductModelJob::dispatch($productModel); } - /** @test */ + #[Test] public function it_can_fail(): void { /** @var ProductModel $productModel */ @@ -45,7 +46,7 @@ public function it_can_fail(): void $this->assertNotNull($productModel->failed_at); } - /** @test */ + #[Test] public function it_has_correct_tags_and_unique_id(): void { /** @var ProductModel $productModel */ diff --git a/tests/Models/MappingTest.php b/tests/Models/MappingTest.php index aa850fa..f9a7fff 100644 --- a/tests/Models/MappingTest.php +++ b/tests/Models/MappingTest.php @@ -5,10 +5,11 @@ use JustBetter\AkeneoProducts\Enums\MappingType; use JustBetter\AkeneoProducts\Models\Mapping; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class MappingTest extends TestCase { - /** @test */ + #[Test] public function it_can_get_a_mapping(): void { /** @var Mapping $mapping */ diff --git a/tests/Models/ProductModelTest.php b/tests/Models/ProductModelTest.php index a3eb826..86fa124 100644 --- a/tests/Models/ProductModelTest.php +++ b/tests/Models/ProductModelTest.php @@ -5,10 +5,11 @@ use JustBetter\AkeneoProducts\Models\ProductModel; use JustBetter\AkeneoProducts\Tests\Fakes\Retrievers\ProductModel\ProductModelRetriever; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class ProductModelTest extends TestCase { - /** @test */ + #[Test] public function it_can_stop_the_synchronization(): void { config()->set('akeneo-products.retrievers.product_model', ProductModelRetriever::class); diff --git a/tests/Models/ProductTest.php b/tests/Models/ProductTest.php index 147bef7..f1c5e1b 100644 --- a/tests/Models/ProductTest.php +++ b/tests/Models/ProductTest.php @@ -5,10 +5,11 @@ use JustBetter\AkeneoProducts\Models\Product; use JustBetter\AkeneoProducts\Tests\Fakes\Retrievers\Product\ProductRetriever; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class ProductTest extends TestCase { - /** @test */ + #[Test] public function it_can_stop_the_synchronization(): void { config()->set('akeneo-products.retrievers.product', ProductRetriever::class); diff --git a/tests/Retrievers/Product/BaseProductRetrieverTest.php b/tests/Retrievers/Product/BaseProductRetrieverTest.php index a26f77b..232909e 100644 --- a/tests/Retrievers/Product/BaseProductRetrieverTest.php +++ b/tests/Retrievers/Product/BaseProductRetrieverTest.php @@ -5,10 +5,11 @@ use JustBetter\AkeneoProducts\Retrievers\Product\BaseProductRetriever; use JustBetter\AkeneoProducts\Retrievers\Product\ProductRetriever; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class BaseProductRetrieverTest extends TestCase { - /** @test */ + #[Test] public function it_can_get_the_current_retriever(): void { $retriever = BaseProductRetriever::current(); diff --git a/tests/Retrievers/Product/ProductRetrieverTest.php b/tests/Retrievers/Product/ProductRetrieverTest.php index d16fef5..af99a38 100644 --- a/tests/Retrievers/Product/ProductRetrieverTest.php +++ b/tests/Retrievers/Product/ProductRetrieverTest.php @@ -5,10 +5,11 @@ use JustBetter\AkeneoProducts\Exceptions\NotImplementedException; use JustBetter\AkeneoProducts\Retrievers\Product\ProductRetriever; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class ProductRetrieverTest extends TestCase { - /** @test */ + #[Test] public function it_can_throw_exceptions(): void { $this->expectException(NotImplementedException::class); diff --git a/tests/Retrievers/ProductModel/BaseProductModelRetrieverTest.php b/tests/Retrievers/ProductModel/BaseProductModelRetrieverTest.php index 149c606..3711396 100644 --- a/tests/Retrievers/ProductModel/BaseProductModelRetrieverTest.php +++ b/tests/Retrievers/ProductModel/BaseProductModelRetrieverTest.php @@ -5,10 +5,11 @@ use JustBetter\AkeneoProducts\Retrievers\ProductModel\BaseProductModelRetriever; use JustBetter\AkeneoProducts\Retrievers\ProductModel\ProductModelRetriever; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class BaseProductModelRetrieverTest extends TestCase { - /** @test */ + #[Test] public function it_can_get_the_current_retriever(): void { $retriever = BaseProductModelRetriever::current(); diff --git a/tests/Retrievers/ProductModel/ProductModelRetrieverTest.php b/tests/Retrievers/ProductModel/ProductModelRetrieverTest.php index 02ab056..5a6f64e 100644 --- a/tests/Retrievers/ProductModel/ProductModelRetrieverTest.php +++ b/tests/Retrievers/ProductModel/ProductModelRetrieverTest.php @@ -5,10 +5,11 @@ use JustBetter\AkeneoProducts\Exceptions\NotImplementedException; use JustBetter\AkeneoProducts\Retrievers\ProductModel\ProductModelRetriever; use JustBetter\AkeneoProducts\Tests\TestCase; +use PHPUnit\Framework\Attributes\Test; class ProductModelRetrieverTest extends TestCase { - /** @test */ + #[Test] public function it_can_throw_exceptions(): void { $this->expectException(NotImplementedException::class);