-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Remove Component namespace on state #762
Conversation
loic425
commented
Oct 25, 2023
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Related tickets | |
License | MIT |
@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')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As idea
$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))) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As idea
$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))) |
438cfb1
to
d74db52
Compare
Thank you, @loic425! |