Skip to content

Commit c8717f0

Browse files
committed
Merge remote-tracking branch 'origin/MC-33147' into 2.4.1-develop-pr25
2 parents 8b3e7a4 + 7d13d0d commit c8717f0

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

dev/tests/integration/testsuite/Magento/Framework/View/LayoutTestWithExceptions.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@
55
*/
66
namespace Magento\Framework\View;
77

8-
use \Magento\Framework\App\State;
8+
use Magento\Framework\App\State;
9+
use Magento\Framework\Exception\LocalizedException;
10+
use Magento\Framework\View\Layout\Element;
11+
use Magento\TestFramework\Helper\Bootstrap;
12+
use PHPUnit\Framework\TestCase;
913

10-
class LayoutTestWithExceptions extends \PHPUnit\Framework\TestCase
14+
/**
15+
* Class to test Layout model functionality with exceptions
16+
*/
17+
class LayoutTestWithExceptions extends TestCase
1118
{
1219
/**
13-
* @var \Magento\Framework\View\Layout
20+
* @var Layout
1421
*/
1522
protected $layout;
1623

@@ -19,10 +26,10 @@ class LayoutTestWithExceptions extends \PHPUnit\Framework\TestCase
1926
*/
2027
protected function setUp(): void
2128
{
22-
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
23-
$layoutFactory = $objectManager->get(\Magento\Framework\View\LayoutFactory::class);
29+
$objectManager = Bootstrap::getObjectManager();
30+
$layoutFactory = $objectManager->get(LayoutFactory::class);
2431
$this->layout = $layoutFactory->create();
25-
$layoutElement = new \Magento\Framework\View\Layout\Element(
32+
$layoutElement = new Element(
2633
__DIR__ . '/_files/layout_with_exceptions/layout.xml',
2734
0,
2835
true
@@ -33,21 +40,24 @@ protected function setUp(): void
3340
}
3441

3542
/**
43+
* Test to Create structure of elements from the loaded XML configuration with exception
3644
*/
3745
public function testProcessWithExceptionsDeveloperMode()
3846
{
39-
$this->expectException(\Magento\Framework\Exception\LocalizedException::class);
47+
$this->expectException(LocalizedException::class);
4048
$this->expectExceptionMessage('Construction problem.');
4149

4250
$this->layout->generateElements();
4351
}
4452

4553
/**
54+
* Test to Get all blocks marked for output with exceptions
55+
*
4656
* @magentoAppIsolation enabled
4757
*/
4858
public function testProcessWithExceptions()
4959
{
50-
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\App\State::class)
60+
Bootstrap::getObjectManager()->get(State::class)
5161
->setMode(State::MODE_DEFAULT);
5262

5363
$this->layout->generateElements();

0 commit comments

Comments
 (0)