protected function setUp(): void
{ $this->shippingRepository =
$this->
getContainer()->
get('shipping_method.repository'
);
$this->shippingMethodId = Uuid::
randomHex();
$this->ruleId = Uuid::
randomHex();
} public function testCreateShippingMethod(): void
{ $defaultContext = Context::
createDefaultContext();
$shippingMethod =
$this->
createShippingMethodDummyArray();
$this->shippingRepository->
create($shippingMethod,
$defaultContext);
$criteria =
new Criteria([$this->shippingMethodId
]);
$criteria->
addAssociation('availabilityRule'
);
$resultSet =
$this->shippingRepository->
search($criteria,
$defaultContext);
/** @var ShippingMethodEntity|null $rule */
$rule =
$resultSet->
first();