Skip to content

Commit 73c5b6a

Browse files
author
Ben Batschelet
committed
Fix incompatible calls to count() in unit and static tests
1 parent eb59db5 commit 73c5b6a

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

app/code/Magento/Backend/Block/Menu.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ protected function _addSubMenu($menuItem, $level, $limit, $id = null)
352352
return $output;
353353
}
354354
$output .= '<div class="submenu"' . ($level == 0 && isset($id) ? ' aria-labelledby="' . $id . '"' : '') . '>';
355-
$colStops = null;
355+
$colStops = [];
356356
if ($level == 0 && $limit) {
357357
$colStops = $this->_columnBrake($menuItem->getChildren(), $limit);
358358
$output .= '<strong class="submenu-title">' . $this->_getAnchorLabel($menuItem) . '</strong>';

dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Backend/ControllerAclTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ private function isItTest($relativeFilePath)
233233
private function getControllerPath($relativeFilePath)
234234
{
235235
if (preg_match('~(Magento\/.*Controller\/Adminhtml\/.*)\.php~', $relativeFilePath, $matches)) {
236-
if (is_array($matches) && count($matches) === 2 && is_array($matches[1]) && count($matches[1]) >= 1) {
236+
if (count($matches) === 2) {
237237
$partPath = $matches[1];
238238
return $partPath;
239239
}

setup/src/Magento/Setup/Test/Unit/Module/I18n/Pack/GeneratorTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ public function testGenerateEmptyFile()
102102
->method('load')
103103
->with($dictionaryPath)
104104
->will($this->returnValue($this->dictionaryMock));
105+
$this->dictionaryMock->expects($this->once())
106+
->method('getPhrases')
107+
->will($this->returnValue([]));
105108

106109
$this->_generator->generate($dictionaryPath, $localeString, $mode, $allowDuplicates);
107110
}

0 commit comments

Comments
 (0)