Skip to content

Commit

Permalink
[ECS] Apply ecs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafikooo committed Jan 17, 2024
1 parent 0fc94be commit b1d58fa
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#[AsCommand(
name: 'sylius:admin-user:change-password',
description: 'Change password of admin user'
description: 'Change password of admin user',
)]
final class ChangeAdminUserPasswordCommand extends Command
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<?php

/*
* This file is part of the Sylius package.
*
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Sylius\Bundle\AdminBundle\Command\Factory;

use Symfony\Component\Console\Question\Question;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function it_does_not_change_password_when_admin_user_is_not_found(): void
$this
->command
->setInputs([
'email' => self::EMAIL
'email' => self::EMAIL,
]);

$this->command->execute([]);
Expand Down Expand Up @@ -128,7 +128,7 @@ public function it_changes_password_for_existing_admin_user(): void
->command
->setInputs([
'email' => self::EMAIL,
'password' => self::PASSWORD
'password' => self::PASSWORD,
]);

$this->command->execute([]);
Expand Down
23 changes: 8 additions & 15 deletions tests/Api/Admin/ProductAssociationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public function it_gets_product_association(): void
->headerBuilder()
->withJsonLdAccept()
->withAdminUserAuthorization('api@example.com')
->build()
,
->build(),
);

$this->assertResponse(
Expand All @@ -62,8 +61,7 @@ public function it_returns_nothing_if_association_not_found(): void
->headerBuilder()
->withJsonLdAccept()
->withAdminUserAuthorization('api@example.com')
->build()
,
->build(),
);

$response = $this->client->getResponse();
Expand All @@ -76,7 +74,7 @@ public function it_returns_product_association_collection(): void
{
$this->loadFixturesFromFiles([
'product/product_with_many_locales.yaml',
'authentication/api_administrator.yaml'
'authentication/api_administrator.yaml',
]);

$this->client->request(
Expand All @@ -86,8 +84,7 @@ public function it_returns_product_association_collection(): void
->headerBuilder()
->withJsonLdAccept()
->withAdminUserAuthorization('api@example.com')
->build()
,
->build(),
);

$this->assertResponse(
Expand All @@ -113,8 +110,7 @@ public function it_creates_product_association(): void
->withJsonLdContentType()
->withJsonLdAccept()
->withAdminUserAuthorization('api@example.com')
->build()
,
->build(),
content: json_encode([
'type' => '/api/v2/admin/product-association-types/similar_products',
'owner' => '/api/v2/admin/products/CUP',
Expand Down Expand Up @@ -149,8 +145,7 @@ public function it_updates_product_association(): void
->withJsonLdContentType()
->withJsonLdAccept()
->withAdminUserAuthorization('api@example.com')
->build()
,
->build(),
content: json_encode([
'associatedProducts' => [
'/api/v2/admin/products/TANKARD',
Expand Down Expand Up @@ -217,8 +212,7 @@ public function it_does_not_create_product_association_without_required_data():
->withJsonLdContentType()
->withJsonLdAccept()
->withAdminUserAuthorization('api@example.com')
->build()
,
->build(),
content: '{}',
);

Expand Down Expand Up @@ -248,8 +242,7 @@ public function it_does_not_create_duplicated_product_association(): void
->withJsonLdContentType()
->withJsonLdAccept()
->withAdminUserAuthorization('api@example.com')
->build()
,
->build(),
content: json_encode([
'type' => sprintf('/api/v2/admin/product-association-types/%s', $association->getType()->getCode()),
'owner' => sprintf('/api/v2/admin/products/%s', $association->getOwner()->getCode()),
Expand Down
2 changes: 2 additions & 0 deletions tests/Api/Shop/ProductsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function it_returns_product_with_translations_in_default_locale(): void

/**
* @test
*
* @dataProvider getGermanLocales
*/
public function it_returns_product_with_translations_in_locale_from_header(string $germanLocale): void
Expand Down Expand Up @@ -138,6 +139,7 @@ public function it_returns_product_item_with_only_available_associations(): void

/**
* @test
*
* @dataProvider getPolishLocales
*/
public function it_returns_product_attributes_collection_with_translations_in_locale_from_header(
Expand Down

0 comments on commit b1d58fa

Please sign in to comment.