Skip to content

Commit

Permalink
Merge pull request #467 from magento-gl/phpunit10
Browse files Browse the repository at this point in the history
[Arrows] Delivery of PHPUnit 10 Upgrade
  • Loading branch information
sidolov authored Jun 7, 2024
2 parents 2ebcef3 + 07d5e79 commit 5dd278d
Show file tree
Hide file tree
Showing 83 changed files with 194 additions and 160 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testValidation($sourceCode, $errorCount, $errorStrings)
/**
* @return array
*/
public function dataProvider()
public static function dataProvider()
{
return [
'valid code string' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testValidation($value, $errorCount, $errorStrings)
/**
* @return array
*/
public function dataProvider()
public static function dataProvider()
{
return [
'valid code string' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function testGetDataForListingDataStock($stockName, $assignedSources): vo
/**
* @return array
*/
public function listingDataStockDataProvider(): array
public static function listingDataStockDataProvider(): array
{
return [[
'Global-stock',
Expand Down
6 changes: 3 additions & 3 deletions InventoryApi/Test/Api/SourceItemsSave/ValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testCreateWithMissedRequiredFields(string $field, array $expecte
/**
* @return array
*/
public function dataProviderRequiredFields(): array
public static function dataProviderRequiredFields(): array
{
return [
'without_' . SourceItemInterface::SKU => [
Expand Down Expand Up @@ -152,7 +152,7 @@ public function testFailedValidationOnCreate(string $field, $value, array $expec
* @return array
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function failedValidationDataProvider(): array
public static function failedValidationDataProvider(): array
{
if (TESTS_WEB_API_ADAPTER === self::ADAPTER_SOAP) {
$nonExistedSourceCodeError = [
Expand Down Expand Up @@ -357,7 +357,7 @@ public function testFailedValidationOnCreateRelatedOnlyForRest(string $field, $v
/**
* @return array
*/
public function failedValidationRelatedOnlyForRestDataProvider(): array
public static function failedValidationRelatedOnlyForRestDataProvider(): array
{
return [
'empty_' . SourceItemInterface::QUANTITY => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class CarrierLinkManagementTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/sources';
const SERVICE_NAME = 'inventoryApiSourceRepositoryV1';
private const RESOURCE_PATH = '/V1/inventory/sources';
private const SERVICE_NAME = 'inventoryApiSourceRepositoryV1';
/**#@-*/

/**
Expand Down Expand Up @@ -54,7 +54,7 @@ public function testCarrierLinksManagement(array $carrierLinks)
/**
* @return array
*/
public function dataProviderCarrierLinks(): array
public static function dataProviderCarrierLinks(): array
{
return [
'add_carrier_new_links' => [
Expand Down
10 changes: 5 additions & 5 deletions InventoryApi/Test/Api/SourceRepository/ValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class ValidationTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/sources';
const SERVICE_NAME = 'inventoryApiSourceRepositoryV1';
private const RESOURCE_PATH = '/V1/inventory/sources';
private const SERVICE_NAME = 'inventoryApiSourceRepositoryV1';
/**#@-*/

/**
Expand Down Expand Up @@ -58,7 +58,7 @@ public function testCreateWithMissedRequiredFields(string $field, array $expecte
/**
* @return array
*/
public function dataProviderRequiredFields(): array
public static function dataProviderRequiredFields(): array
{
return [
'without_' . SourceInterface::NAME => [
Expand Down Expand Up @@ -162,7 +162,7 @@ public function testFailedValidationOnUpdate(string $field, $value, array $expec
* @return array
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function failedValidationDataProvider(): array
public static function failedValidationDataProvider(): array
{
return [
'null_' . SourceInterface::SOURCE_CODE => [
Expand Down Expand Up @@ -375,7 +375,7 @@ public function failedValidationDataProvider(): array
* @return array
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function failedValidationUpdateDataProvider(): array
public static function failedValidationUpdateDataProvider(): array
{
return [
'null_' . SourceInterface::NAME => [
Expand Down
6 changes: 3 additions & 3 deletions InventoryApi/Test/Api/StockRepository/GetListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class GetListTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/stocks';
const SERVICE_NAME = 'inventoryApiStockRepositoryV1';
private const RESOURCE_PATH = '/V1/inventory/stocks';
private const SERVICE_NAME = 'inventoryApiStockRepositoryV1';
/**#@-*/

/**
Expand Down Expand Up @@ -55,7 +55,7 @@ public function testGetList(array $searchCriteria, int $expectedTotalCount, arra
/**
* @return array
*/
public function dataProviderGetList(): array
public static function dataProviderGetList(): array
{
return [
'filtering' => [
Expand Down
8 changes: 4 additions & 4 deletions InventoryApi/Test/Api/StockRepository/ValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class ValidationTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH = '/V1/inventory/stocks';
const SERVICE_NAME = 'inventoryApiStockRepositoryV1';
private const RESOURCE_PATH = '/V1/inventory/stocks';
private const SERVICE_NAME = 'inventoryApiStockRepositoryV1';
/**#@-*/

/**
Expand Down Expand Up @@ -56,7 +56,7 @@ public function testCreateWithMissedRequiredFields(string $field, array $expecte
/**
* @return array
*/
public function dataProviderRequiredFields(): array
public static function dataProviderRequiredFields(): array
{
return [
'without_' . StockInterface::NAME => [
Expand Down Expand Up @@ -167,7 +167,7 @@ public function testFailedValidationOnUpdate(string $field, $value, array $expec
/**
* @return array
*/
public function failedValidationDataProvider(): array
public static function failedValidationDataProvider(): array
{
return [
'empty_' . StockInterface::NAME => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testGetStatusIfScopeIdParameterIsPassed(string $sku, int $status
/**
* @return array
*/
public function getStockDataProvider(): array
public static function getStockDataProvider(): array
{
return [
['bundle-product-in-stock', 1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testGetStatusIfScopeIdParameterIsPassed(string $sku, int $status
/**
* @return array
*/
public function getStockDataProvider(): array
public static function getStockDataProvider(): array
{
return [
['bundle-product-in-stock', 1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function testGetStatusIfScopeIdParameterIsPassed(string $sku, int $status
/**
* @return array
*/
public function getStockDataProvider(): array
public static function getStockDataProvider(): array
{
return [
['bundle-product-in-stock', 1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function testGetStatusIfScopeIdParameterIsPassed(string $sku, int $status
/**
* @return array
*/
public function getStockDataProvider(): array
public static function getStockDataProvider(): array
{
return [
['bundle-product-in-stock', 1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function testExecuteList(array $newSourceData, bool $expectedStockStatus)
self::assertEquals($expectedStockStatus, (bool) $bundleStockItem[GetStockItemDataInterface::IS_SALABLE]);
}

public function executeListDataProvider(): array
public static function executeListDataProvider(): array
{
return [
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class PreventAssignSourcesToDefaultStockTest extends WebapiAbstract
/**#@+
* Service constants
*/
const RESOURCE_PATH_ASSIGN_SOURCES_TO_STOCK = '/V1/inventory/stock-source-links';
const SERVICE_NAME_ASSIGN_SOURCES_TO_STOCK = 'inventoryApiStockSourceLinksSaveV1';
private const RESOURCE_PATH_ASSIGN_SOURCES_TO_STOCK = '/V1/inventory/stock-source-links';
private const SERVICE_NAME_ASSIGN_SOURCES_TO_STOCK = 'inventoryApiStockSourceLinksSaveV1';
/**#@-*/

/**
Expand Down Expand Up @@ -87,7 +87,7 @@ public function testAssignSourcesToStockWithWrongParameters(
/**
* @return array
*/
public function dataProviderWrongParameters(): array
public static function dataProviderWrongParameters(): array
{
$defaultSourceProvider = Bootstrap::getObjectManager()->get(DefaultSourceProviderInterface::class);
$defaultStockProvider = Bootstrap::getObjectManager()->get(DefaultStockProviderInterface::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public function testProductListMoveOutOfStockToBottom(
*
* @return array
*/
public function productListWithShowOutOfStockSortOrderDataProvider(): array
public static function productListWithShowOutOfStockSortOrderDataProvider(): array
{
return [
'default_order_price_asc' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function testGetStatusIfScopeIdParameterIsPassed(string $sku, int $status
/**
* @return array
*/
public function getStatusDataProvider(): array
public static function getStatusDataProvider(): array
{
return [
['SKU-1', 1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function testGetStatusIfScopeIdParameterIsPassed(
/**
* @return array
*/
public function getStatusDataProvider(): array
public static function getStatusDataProvider(): array
{
return [
['store_for_eu_website', 'SKU-1', 1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function testGetStatusIfScopeIdParameterIsPassed(string $sku, int $status
/**
* @return array
*/
public function getStatusDataProvider(): array
public static function getStatusDataProvider(): array
{
return [
['SKU-1', 1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function testGetStatusIfScopeIdParameterIsPassed(
/**
* @return array
*/
public function getStatusDataProvider(): array
public static function getStatusDataProvider(): array
{
return [
['store_for_eu_website', 'SKU-1', 1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function testGetStatusIfScopeIdParameterIsPassed(
/**
* @return array
*/
public function getStatusDataProvider(): array
public static function getStatusDataProvider(): array
{
return [
['store_for_eu_website', 'SKU-1', 1, 8.5],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testGetStatusIfScopeIdParameterIsPassed(string $sku, int $status
/**
* @return array
*/
public function getStatusDataProvider(): array
public static function getStatusDataProvider(): array
{
return [
['SKU-1', 1, 5.5],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function testGetStatusIfScopeIdParameterIsPassed(
/**
* @return array
*/
public function getStatusDataProvider(): array
public static function getStatusDataProvider(): array
{
return [
['store_for_eu_website', 'SKU-1', 1, 8.5],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function testGetStatusIfScopeIdParameterIsPassed(string $sku, int $status
/**
* @return array
*/
public function getStatusDataProvider(): array
public static function getStatusDataProvider(): array
{
return [
['SKU-1', 1, 5.5],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function testGetStatusIfScopeIdParameterIsPassed(
/**
* @return array
*/
public function getStatusDataProvider(): array
public static function getStatusDataProvider(): array
{
return [
['store_for_eu_website', 'SKU-1', 1, 8.5],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testAddInStockFilterToCollection(string $store, int $expectedSiz
/**
* @return array
*/
public function addInStockFilterToCollectionDataProvider(): array
public static function addInStockFilterToCollectionDataProvider(): array
{
return [
['store_for_eu_website', 3],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testAddStockStatusToProducts(string $storeCode, array $productsD
/**
* @return array
*/
public function addStockStatusToProductsDataProvider(): array
public static function addStockStatusToProductsDataProvider(): array
{
return [
'eu_website' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function testAssignStatusToProductIfStatusParameterIsPassed(string $store
/**
* @return array
*/
public function assignStatusToProductDataProvider(): array
public static function assignStatusToProductDataProvider(): array
{
return [
'eu_website' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testAddIsInStockFilterToCollection(string $store, int $expectedS
/**
* @return array
*/
public function addIsInStockFilterToCollectionDataProvider(): array
public static function addIsInStockFilterToCollectionDataProvider(): array
{
return [
['store_for_eu_website', 3],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function testExecute(string $storeCode, string $dir, array $expectedOrder
/**
* @return array
*/
public function executeDataProvider(): array
public static function executeDataProvider(): array
{
return [
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testAddStockDataToCollection(int $expectedSize, bool $isFilterIn
/**
* @return array
*/
public function addStockDataToCollectionDataProvider(): array
public static function addStockDataToCollectionDataProvider(): array
{
return [
[4, true],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testAddStockDataToCollection(string $store, int $expectedSize, b
/**
* @return array
*/
public function addStockDataToCollectionDataProvider(): array
public static function addStockDataToCollectionDataProvider(): array
{
return [
['store_for_eu_website', 3, true],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function testAddStockStatusToSelect(
/**
* @return array
*/
public function addStockStatusToSelectDataProvider(): array
public static function addStockStatusToSelectDataProvider(): array
{
return [
['eu_website', 3, 3],
Expand Down
2 changes: 1 addition & 1 deletion InventoryCatalog/Test/Integration/NegativeMinQtyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function testIsProductSalableForRequestedQtyWithBackordersEnabledAtProduc
*
* @return array
*/
public function isProductSalableForRequestedQtyWithBackordersEnabledAtProductLevelDataProvider(): array
public static function isProductSalableForRequestedQtyWithBackordersEnabledAtProductLevelDataProvider(): array
{
return [
'salable_qty' => ['SKU-1', 10, -4.5, 13, true],
Expand Down
Loading

0 comments on commit 5dd278d

Please sign in to comment.