Skip to content

Commit 552c81f

Browse files
eduard13andrewbess
authored andcommitted
Fixing integration tests' warnings
1 parent 9cb767c commit 552c81f

File tree

10 files changed

+40
-26
lines changed

10 files changed

+40
-26
lines changed

app/code/Magento/Analytics/Model/Config/Mapper.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ public function execute($configData)
5252
$providerData['parameters'] = !empty($providerData['parameters'])
5353
? reset($providerData['parameters'])
5454
: [];
55-
$providerData['parameters'] = array_map(
56-
'reset',
57-
$providerData['parameters']
58-
);
55+
array_walk($providerData['parameters'], function (&$array) {
56+
$array = reset($array);
57+
});
5958
$providers[$providerType] = $providerData;
6059
}
6160
$files[$fileData['name']] = $fileData;

app/code/Magento/Customer/Model/AccountManagement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ public function validate(CustomerInterface $customer)
11161116
// phpcs:ignore Magento2.Functions.DiscouragedFunction
11171117
call_user_func_array(
11181118
'array_merge',
1119-
$this->getEavValidator()->getMessages()
1119+
array_values($this->getEavValidator()->getMessages())
11201120
)
11211121
);
11221122
}

app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Address/Storage.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ private function loadAddresses(array $customerIds): void
9898
$select->reset(Select::COLUMNS)->columns([$tableId . '.entity_id', $tableId . '.parent_id']);
9999

100100
$pageSize = $this->config->getValue(AbstractEntity::XML_PATH_PAGE_SIZE);
101+
$pageSize = !is_null($pageSize) ? (int) $pageSize : null;
101102
$getChuck = function (int $offset) use ($customerIds, $pageSize) {
102103
return array_slice($customerIds, $offset, $pageSize);
103104
};

app/code/Magento/Paypal/Model/Cart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ protected function _importItemsFromSalesModel()
150150
$this->addSubtotal($this->_salesModel->getBaseSubtotal());
151151
$this->addTax($this->_salesModel->getBaseTaxAmount());
152152
$this->addShipping($this->_salesModel->getBaseShippingAmount());
153-
$this->addDiscount(abs($this->_salesModel->getBaseDiscountAmount()));
153+
$this->addDiscount(abs((float) $this->_salesModel->getBaseDiscountAmount()));
154154
}
155155

156156
/**

app/code/Magento/Sales/Model/ResourceModel/Order/Status.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function checkIsStateLast($state)
206206
$this->getConnection()->select()
207207
->from(['sss' => $this->stateTable], [])
208208
->where('state = ?', $state)
209-
->columns([new\Zend_Db_Expr('COUNT(1)')])
209+
->columns([new \Zend_Db_Expr('COUNT(1)')])
210210
));
211211
}
212212

dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/AbstractProductExportImportTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ protected function executeImportReplaceTest(
363363
/** @var \ReflectionProperty $itemsPerPageProperty */
364364
$itemsPerPageProperty = $this->objectManager->create(\ReflectionProperty::class, [
365365
'class' => \Magento\CatalogImportExport\Model\Export\Product::class,
366-
'name' => '_itemsPerPage'
366+
'property' => '_itemsPerPage'
367367
]);
368368
$itemsPerPageProperty->setAccessible(true);
369369
$itemsPerPageProperty->setValue($exportProduct, 1);

dev/tests/integration/testsuite/Magento/Framework/Filter/TemplateTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function getThings()
5656
['name' => 'Richard', 'age' => 24],
5757
['name' => 'Jane', 'age' => 12],
5858
['name' => 'Spot', 'age' => 7],
59+
['name' => 'Bill', 'age' => '25']
5960
];
6061
}
6162

@@ -105,12 +106,12 @@ public function getFilterForDataProvider()
105106

106107
$expectedResult2 = <<<EXPECTED_RESULT
107108
<ul>
108-
109+
109110
<li>
110111
index: 0 sku: ABC123
111112
name: Product ABC price: 123 quantity: 2
112113
</li>
113-
114+
114115
</ul>
115116
EXPECTED_RESULT;
116117
return [

dev/tests/integration/testsuite/Magento/Framework/View/Utility/Layout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function getLayoutDependencies()
105105
'structure' => $objectManager->create(\Magento\Framework\View\Layout\Data\Structure::class, []),
106106
'messageManager' => $objectManager->get(\Magento\Framework\Message\ManagerInterface::class),
107107
'themeResolver' => $objectManager->get(\Magento\Framework\View\Design\Theme\ResolverInterface::class),
108-
'reader' => $objectManager->get('commonRenderPool'),
108+
'readerPool' => $objectManager->get('commonRenderPool'),
109109
'generatorPool' => $objectManager->get(\Magento\Framework\View\Layout\GeneratorPool::class),
110110
'cache' => $objectManager->get(\Magento\Framework\App\Cache\Type\Layout::class),
111111
'readerContextFactory' => $objectManager->get(\Magento\Framework\View\Layout\Reader\ContextFactory::class),

dev/tests/integration/testsuite/Magento/PaypalGraphQl/PaypalExpressAbstractTest.php

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
use Magento\Framework\Exception\LocalizedExceptionFactory;
1414
use Magento\Framework\HTTP\Adapter\CurlFactory;
1515
use Magento\Framework\Locale\ResolverInterface;
16+
use Magento\Framework\Math\Random;
1617
use Magento\GraphQl\Controller\GraphQl;
1718
use Magento\GraphQl\Service\GraphQlRequest;
1819
use Magento\Payment\Model\Method\Logger;
1920
use Magento\Paypal\Model\Api\Nvp;
21+
use Magento\Paypal\Model\Api\NvpFactory;
2022
use Magento\Paypal\Model\Api\PayflowNvp;
2123
use Magento\Paypal\Model\Api\AbstractApi;
2224
use Magento\Paypal\Model\Api\ProcessableExceptionFactory;
@@ -150,21 +152,28 @@ protected function disablePaypalPaymentMethods(): void
150152
private function getNvpMock(string $nvpClass)
151153
{
152154
if (empty($this->nvpMock)) {
155+
$constructorArgs = [
156+
'customerAddress' => $this->objectManager->get(Address::class),
157+
'logger' => $this->objectManager->get(LoggerInterface::class),
158+
'customLogger' => $this->objectManager->get(Logger::class),
159+
'localeResolver' => $this->objectManager->get(ResolverInterface::class),
160+
'regionFactory' => $this->objectManager->get(RegionFactory::class),
161+
'countryFactory' => $this->objectManager->get(CountryFactory::class),
162+
'processableExceptionFactory' => $this->objectManager->get(ProcessableExceptionFactory::class),
163+
'frameworkExceptionFactory' => $this->objectManager->get(LocalizedExceptionFactory::class),
164+
'curlFactory' => $this->objectManager->get(CurlFactory::class),
165+
];
166+
167+
if ($nvpClass === PayflowNvp::class) {
168+
$constructorArgs += [
169+
'mathRandom' => $this->objectManager->get(Random::class),
170+
'nvpFactory' => $this->objectManager->get(NvpFactory::class)
171+
];
172+
}
173+
174+
$constructorArgs += ['data' => []];
153175
$this->nvpMock = $this->getMockBuilder($nvpClass)
154-
->setConstructorArgs(
155-
[
156-
'customerAddress' => $this->objectManager->get(Address::class),
157-
'logger' => $this->objectManager->get(LoggerInterface::class),
158-
'customerLogger' => $this->objectManager->get(Logger::class),
159-
'resolverInterface' => $this->objectManager->get(ResolverInterface::class),
160-
'regionFactory' => $this->objectManager->get(RegionFactory::class),
161-
'countryFactory' => $this->objectManager->get(CountryFactory::class),
162-
'processableExceptionFactory' => $this->objectManager->get(ProcessableExceptionFactory::class),
163-
'frameworkExceptionFactory' => $this->objectManager->get(LocalizedExceptionFactory::class),
164-
'curlFactory' => $this->objectManager->get(CurlFactory::class),
165-
'data' => []
166-
]
167-
)
176+
->setConstructorArgs($constructorArgs)
168177
->setMethods(['call'])
169178
->getMock();
170179
}

lib/internal/Magento/Framework/Filter/DirectiveProcessor/ForDirective.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ private function getLoopReplacementText(
132132
$subText = $loopTextToReplace;
133133
foreach ($attributes as $attribute) {
134134
$text = $this->variableResolver->resolve($attribute[2], $filter, $templateVariables);
135-
$subText = str_replace($attribute[0], $text, $subText);
135+
$subText = str_replace(
136+
$attribute[0],
137+
is_array($text) ? $text : (string) $text,
138+
$subText
139+
);
136140
}
137141
$loopText[] = $subText;
138142
}

0 commit comments

Comments
 (0)