defaultSourceProvider = Bootstrap::getObjectManager()->get(DefaultSourceProviderInterface::class); $this->defaultStockProvider = Bootstrap::getObjectManager()->get(DefaultStockProviderInterface::class); } /** * Test that default Stock is present after installation */ public function testGetDefaultStockToSourceLink() { $defaultStockId = $this->defaultStockProvider->getId(); $defaultSourceCode = $this->defaultSourceProvider->getCode(); $serviceInfo = [ 'rest' => [ 'resourcePath' => '/V1/inventory/get-sources-assigned-to-stock-ordered-by-priority/' . $defaultStockId, 'httpMethod' => Request::HTTP_METHOD_GET, ], 'soap' => [ 'service' => 'inventoryApiGetSourcesAssignedToStockOrderedByPriorityV1', 'operation' => 'inventoryApiGetSourcesAssignedToStockOrderedByPriorityV1Execute', ], ]; if (self::ADAPTER_REST === TESTS_WEB_API_ADAPTER) { $source = $this->_webApiCall($serviceInfo); } else { $source = $this->_webApiCall($serviceInfo, ['stockId' => $defaultStockId]); } $this->assertEquals([$defaultSourceCode], array_column($source, SourceInterface::SOURCE_CODE)); } }