Skip to content

Commit

Permalink
Merge pull request #8849 from magento-gl/Hammer-247-delivery-21Mar24
Browse files Browse the repository at this point in the history
Hammer 247 delivery 21 mar24
  • Loading branch information
sidolov authored Mar 22, 2024
2 parents 1351424 + e340321 commit d606831
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ protected function setUp(): void
$this->customOptionFactoryMock
]
];
$this->prepareObjectManager($objects);
$this->objectManager->prepareObjectManager($objects);

$this->helper = $this->objectManager->getObject(
Helper::class,
Expand Down Expand Up @@ -772,22 +772,4 @@ private function assembleProductRepositoryMock($links)
->method('getById')
->willReturnMap($repositoryReturnMap);
}

/**
* @param $map
*/
private function prepareObjectManager($map)
{
$objectManagerMock = $this->getMockBuilder(ObjectManagerInterface::class)
->addMethods(['getInstance'])
->onlyMethods(['get'])
->getMockForAbstractClass();

$objectManagerMock->method('getInstance')->willReturnSelf();
$objectManagerMock->method('get')->willReturnMap($map);

$reflectionProperty = new \ReflectionProperty(\Magento\Framework\App\ObjectManager::class, '_instance');
$reflectionProperty->setAccessible(true);
$reflectionProperty->setValue($objectManagerMock);
}
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@
"monolog/monolog": "^2.7",
"opensearch-project/opensearch-php": "^1.0 || ^2.0",
"pelago/emogrifier": "^7.0",
"php-amqplib/php-amqplib": "^3.2, <3.6",
"php-amqplib/php-amqplib": "^3.2",
"phpseclib/mcrypt_compat": "^2.0",
"phpseclib/phpseclib": "^3.0",
"psr/log": "^2 || ^3",
"ramsey/uuid": "^4.2",
"symfony/console": "^6.4",
"symfony/intl": "^6.4",
Expand Down
16 changes: 8 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
$analysisResult->isDefaultLevelUsed(),
$analysisResult->getProjectConfigFile(),
$analysisResult->isResultCacheSaved(),
$analysisResult->getPeakMemoryUsageBytes()
$analysisResult->getPeakMemoryUsageBytes(),
$analysisResult->isResultCacheUsed()
);

return $this->tableErrorFormatter->formatErrors($clearedAnalysisResult, $output);
Expand Down
11 changes: 9 additions & 2 deletions lib/internal/Magento/Framework/Amqp/Connection/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,15 @@ public function create(FactoryOptions $options): AbstractConnection
$parameters['ssl_options'] = $options->getSslOptions() !== null
? $options->getSslOptions()
: ['verify_peer' => true];
return ObjectManager::getInstance()->create($connectionType, $parameters);
}

return ObjectManager::getInstance()->create($connectionType, $parameters);
// need to revert the changes in scope of this ticket - AC-11673
return new AMQPStreamConnection(
$parameters['host'],
$parameters['port'],
$parameters['user'],
$parameters['password'],
$parameters['vhost']
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ public function connectionDataProvider()
'ssl_enabled' => true,
'connection_class' => AMQPSSLConnection::class,
],
[
'ssl_enabled' => false,
'connection_class' => AMQPStreamConnection::class,
],
// [ // Need to revert in scope of this ticket - AC-11673
// 'ssl_enabled' => false,
// 'connection_class' => AMQPStreamConnection::class,
// ],
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,6 @@ public function prepareObjectManager(array $map = [])

$reflectionProperty = new \ReflectionProperty(AppObjectManager::class, '_instance');
$reflectionProperty->setAccessible(true);
$reflectionProperty->setValue($objectManagerMock);
$reflectionProperty->setValue($objectManagerMock, $objectManagerMock);
}
}
1 change: 1 addition & 0 deletions lib/internal/Magento/Framework/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"magento/zend-db": "^1.16",
"magento/zend-pdf": "^1.16",
"monolog/monolog": "^2.7",
"psr/log": "^2 || ^3",
"ramsey/uuid": "^4.2",
"symfony/console": "^6.4",
"symfony/intl": "^6.4",
Expand Down

0 comments on commit d606831

Please sign in to comment.