]);
$this->salesChannelContext =
$this->
getSalesChannelContext();
$this->switcher =
new BlockedShippingMethodSwitcher( $this->
getShippingMethodRoute() );
} public function testSwitchDoesNotSwitchWithNoErrors(): void
{ $errorCollection =
$this->
getErrorCollection();
$newShippingMethod =
$this->switcher->
switch($errorCollection,
$this->salesChannelContext
);
static::
assertSame('original-shipping-method-id',
$newShippingMethod->
getId());
// Assert notices
$errorCollectionFiltered =
$errorCollection->
filter( fn ($error) =>
$error instanceof ShippingMethodChangedError
);
static::
assertCount(0,
$errorCollectionFiltered);
}