executeStep('carrier provider', function () { /** @var PaginatedApiDataProviderInterface $provider */ $provider = $this->container->getService(CarrierDataProvider::class); $this->handle($provider); }); $this->executeStep('cart provider', function () { /** @var PaginatedApiDataProviderInterface $provider */ $provider = $this->container->getService(CartDataProvider::class); $this->handle($provider); }); $this->executeStep('category provider', function () { /** @var PaginatedApiDataProviderInterface $provider */ $provider = $this->container->getService(CategoryDataProvider::class); $this->handle($provider); }); $this->executeStep('modules provider', function () { /** @var PaginatedApiDataProviderInterface $provider */ $provider = $this->container->getService(ModuleDataProvider::class); $this->handle($provider); }); $this->executeStep('order provider', function () { /** @var PaginatedApiDataProviderInterface $provider */ $provider = $this->container->getService(OrderDataProvider::class); $this->handle($provider); }); $this->executeStep('product provider', function () { /** @var PaginatedApiDataProviderInterface $provider */ $provider = $this->container->getService(ProductDataProvider::class); $this->handle($provider); }); $this->executeStep('custom price provider', function () { /** @var PaginatedApiDataProviderInterface $provider */ $provider = $this->container->getService(CustomPriceDataProvider::class); $this->handle($provider); }); $this->executeStep('custom product carrier', function () { /** @var PaginatedApiDataProviderInterface $provider */ $provider = $this->container->getService(CustomProductCarrierDataProvider::class); $this->handle($provider); }); } private function handle(PaginatedApiDataProviderInterface $dataProvider) { $formattedData = $dataProvider->getFormattedData(0, 50, 'en'); foreach ($formattedData as $data) { $this->assertArrayHasKey('collection', $data); $this->assertArrayHasKey('id', $data); $this->assertArrayHasKey('properties', $data); } } }