Definition at line 11 of file AppAreaTest.php.
◆ getTestAppAreaDataProvider()
getTestAppAreaDataProvider |
( |
| ) |
|
Definition at line 49 of file AppAreaTest.php.
52 'method scope' => [[
'method' => [
'magentoAppArea' => [
'adminhtml']]],
'adminhtml'],
53 'class scope' => [[
'class' => [
'magentoAppArea' => [
'frontend']]],
'frontend'],
56 'class' => [
'magentoAppArea' => [
'adminhtml']],
57 'method' => [
'magentoAppArea' => [
'frontend']],
61 'default area' => [[],
'global']
◆ setUp()
Definition at line 28 of file AppAreaTest.php.
30 $this->_testCaseMock = $this->createMock(\PHPUnit\Framework\TestCase::class);
31 $this->_applicationMock = $this->createMock(\
Magento\TestFramework\Application::class);
32 $this->_object = new \Magento\TestFramework\Annotation\AppArea($this->_applicationMock);
◆ startTestWithDifferentAreaCodes()
startTestWithDifferentAreaCodes |
( |
| ) |
|
◆ testGetTestAppArea()
testGetTestAppArea |
( |
|
$annotations, |
|
|
|
$expectedArea |
|
) |
| |
- Parameters
-
array | $annotations | |
string | $expectedArea | @dataProvider getTestAppAreaDataProvider |
Definition at line 40 of file AppAreaTest.php.
42 $this->_testCaseMock->expects($this->once())->method(
'getAnnotations')->will($this->returnValue($annotations));
43 $this->_applicationMock->expects($this->any())->method(
'getArea')->will($this->returnValue(
null));
44 $this->_applicationMock->expects($this->once())->method(
'reinitialize');
45 $this->_applicationMock->expects($this->once())->method(
'loadArea')->with($expectedArea);
46 $this->_object->startTest($this->_testCaseMock);
◆ testGetTestAppAreaWithInvalidArea()
testGetTestAppAreaWithInvalidArea |
( |
| ) |
|
@expectedException \Magento\Framework\Exception\LocalizedException
Definition at line 68 of file AppAreaTest.php.
70 $annotations = [
'method' => [
'magentoAppArea' => [
'some_invalid_area']]];
71 $this->_testCaseMock->expects($this->once())->method(
'getAnnotations')->will($this->returnValue($annotations));
72 $this->_object->startTest($this->_testCaseMock);
◆ testStartTestPreventDoubleAreaLoading()
testStartTestPreventDoubleAreaLoading |
( |
| ) |
|
Definition at line 102 of file AppAreaTest.php.
104 $annotations = [
'method' => [
'magentoAppArea' => [
'adminhtml']]];
105 $this->_testCaseMock->expects($this->once())->method(
'getAnnotations')->will($this->returnValue($annotations));
106 $this->_applicationMock->expects($this->once())->method(
'getArea')->will($this->returnValue(
'adminhtml'));
107 $this->_applicationMock->expects($this->never())->method(
'reinitialize');
108 $this->_applicationMock->expects($this->never())->method(
'loadArea');
109 $this->_object->startTest($this->_testCaseMock);
◆ testStartTestPreventDoubleAreaLoadingAfterReinitialization()
testStartTestPreventDoubleAreaLoadingAfterReinitialization |
( |
| ) |
|
Definition at line 91 of file AppAreaTest.php.
93 $annotations = [
'method' => [
'magentoAppArea' => [
'global']]];
94 $this->_testCaseMock->expects($this->once())->method(
'getAnnotations')->will($this->returnValue($annotations));
95 $this->_applicationMock->expects($this->at(0))->method(
'getArea')->will($this->returnValue(
'adminhtml'));
96 $this->_applicationMock->expects($this->once())->method(
'reinitialize');
97 $this->_applicationMock->expects($this->at(2))->method(
'getArea')->will($this->returnValue(
'global'));
98 $this->_applicationMock->expects($this->never())->method(
'loadArea');
99 $this->_object->startTest($this->_testCaseMock);
◆ testStartTestWithDifferentAreaCodes()
testStartTestWithDifferentAreaCodes |
( |
string |
$areaCode | ) |
|
Check startTest() with different allowed area codes.
@dataProvider startTestWithDifferentAreaCodes
- Parameters
-
Definition at line 81 of file AppAreaTest.php.
83 $annotations = [
'method' => [
'magentoAppArea' => [$areaCode]]];
84 $this->_testCaseMock->expects($this->once())->method(
'getAnnotations')->will($this->returnValue($annotations));
85 $this->_applicationMock->expects($this->any())->method(
'getArea')->willReturn(
null);
86 $this->_applicationMock->expects($this->once())->method(
'reinitialize');
87 $this->_applicationMock->expects($this->once())->method(
'loadArea')->with($areaCode);
88 $this->_object->startTest($this->_testCaseMock);
◆ $_applicationMock
◆ $_object
◆ $_testCaseMock
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/AppAreaTest.php