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);
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);
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']
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);
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);
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);
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);
testGetTestAppAreaWithInvalidArea()
testGetTestAppArea($annotations, $expectedArea)
testStartTestPreventDoubleAreaLoadingAfterReinitialization()
testStartTestPreventDoubleAreaLoading()
testStartTestWithDifferentAreaCodes(string $areaCode)
getTestAppAreaDataProvider()
startTestWithDifferentAreaCodes()