Skip to content

Commit 1cd27f4

Browse files
committed
2907: Integration Test Annotation magentoAppArea breaks with some valid values.
1 parent 321278b commit 1cd27f4

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

dev/tests/integration/framework/Magento/TestFramework/Annotation/AppArea.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ class AppArea
1515
private $_application;
1616

1717
/**
18-
* List of allowed areas
18+
* List of allowed areas.
1919
*
2020
* @var array
2121
*/
2222
private $_allowedAreas = [
2323
\Magento\Framework\App\Area::AREA_GLOBAL,
24-
\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE,
24+
\Magento\Framework\App\Area::AREA_ADMINHTML,
2525
\Magento\Framework\App\Area::AREA_FRONTEND,
26-
'webapi_rest',
27-
'webapi_soap',
28-
'cron',
26+
\Magento\Framework\App\Area::AREA_WEBAPI_REST,
27+
\Magento\Framework\App\Area::AREA_WEBAPI_SOAP,
28+
\Magento\Framework\App\Area::AREA_CRONTAB,
2929
];
3030

3131
/**

dev/tests/integration/framework/Magento/TestFramework/Application.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ public function getArea()
600600
*
601601
* @param string $areaCode
602602
* @return void
603+
* @throws \Magento\Framework\Exception\LocalizedException
603604
*/
604605
public function loadArea($areaCode)
605606
{
@@ -616,7 +617,14 @@ public function loadArea($areaCode)
616617
)
617618
);
618619
$app = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\App\AreaList::class);
619-
if ($areaCode == \Magento\TestFramework\Application::DEFAULT_APP_AREA) {
620+
$areasForPartialLoading = [
621+
\Magento\Framework\App\Area::AREA_GLOBAL,
622+
\Magento\Framework\App\Area::AREA_WEBAPI_REST,
623+
\Magento\Framework\App\Area::AREA_WEBAPI_SOAP,
624+
\Magento\Framework\App\Area::AREA_CRONTAB,
625+
626+
];
627+
if (in_array($areaCode, $areasForPartialLoading, true)) {
620628
$app->getArea($areaCode)->load(\Magento\Framework\App\Area::PART_CONFIG);
621629
} else {
622630
\Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea($areaCode);

0 commit comments

Comments
 (0)