Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Component namespace on state #762

Merged
merged 4 commits into from
Oct 31, 2023

Conversation

loic425
Copy link
Member

@loic425 loic425 commented Oct 25, 2023

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets
License MIT

@loic425 loic425 requested a review from a team as a code owner October 25, 2023 08:27
@loic425
Copy link
Member Author

loic425 commented Oct 25, 2023

@diimpp Also introduced in 1.11 alpha

@@ -73,7 +73,7 @@ function it_throws_an_exception_when_configured_provider_is_not_a_provider_insta
$locator->has('\stdClass')->willReturn(true);
$locator->get('\stdClass')->willReturn(new \stdClass());

$this->shouldThrow(new \InvalidArgumentException('Expected an instance of Sylius\Component\Resource\State\ProviderInterface. Got: stdClass'))
$this->shouldThrow(new \InvalidArgumentException('Expected an instance of Sylius\Resource\State\ProviderInterface. Got: stdClass'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As idea

Suggested change
$this->shouldThrow(new \InvalidArgumentException('Expected an instance of Sylius\Resource\State\ProviderInterface. Got: stdClass'))
$this->shouldThrow(new \InvalidArgumentException(sprintf('Expected an instance of %s. Got: %s', ProviderInterface::class, \stdClass::class)))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think I've read that it's better not to use constants and things like that in specs/tests.
@lchrusciel @Zales0123?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong opinion about that. Will the test still make sense if we would move provider to other namespace? Yup. Both approaches are fine for me

@@ -73,7 +73,7 @@ function it_throws_an_exception_when_configured_processor_is_not_a_processor_ins
$locator->has('\stdClass')->willReturn(true);
$locator->get('\stdClass')->willReturn(new \stdClass());

$this->shouldThrow(new \InvalidArgumentException('Expected an instance of Sylius\Component\Resource\State\ProcessorInterface. Got: stdClass'))
$this->shouldThrow(new \InvalidArgumentException('Expected an instance of Sylius\Resource\State\ProcessorInterface. Got: stdClass'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As idea

Suggested change
$this->shouldThrow(new \InvalidArgumentException('Expected an instance of Sylius\Resource\State\ProcessorInterface. Got: stdClass'))
$this->shouldThrow(new \InvalidArgumentException(sprintf('Expected an instance of %s. Got: %s', ProcessorInterface::class, \stdClass::class)))

@loic425 loic425 force-pushed the move-component-namespace/state branch from 438cfb1 to d74db52 Compare October 30, 2023 08:25
@lchrusciel lchrusciel merged commit 7ec3b8a into Sylius:1.11 Oct 31, 2023
60 checks passed
@lchrusciel
Copy link
Member

Thank you, @loic425!

@loic425 loic425 deleted the move-component-namespace/state branch November 1, 2023 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants