Preview Test
@SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 22 of file PreviewTest.php.
◆ setUp()
Definition at line 64 of file PreviewTest.php.
68 $this->coreRegistryMock = $this->getMockBuilder(\
Magento\Framework\Registry::class)
69 ->disableOriginalConstructor()
71 $this->viewMock = $this->getMockBuilder(\
Magento\Framework\
App\View::class)
72 ->disableOriginalConstructor()
74 $this->requestMock = $this->getMockBuilder(\
Magento\Framework\
App\RequestInterface::class)
76 $this->pageMock = $this->getMockBuilder(\
Magento\Framework\View\Result\Page::class)
77 ->disableOriginalConstructor()
78 ->setMethods([
'getConfig'])
80 $this->pageConfigMock = $this->getMockBuilder(\
Magento\Framework\View\Page\Config::class)
81 ->setMethods([
'getTitle'])
82 ->disableOriginalConstructor()
84 $this->pageTitleMock = $this->getMockBuilder(\
Magento\Framework\View\Page\Title::class)
85 ->setMethods([
'prepend'])
86 ->disableOriginalConstructor()
89 $this->responseMock = $this->getMockBuilder(\
Magento\Framework\
App\ResponseInterface::class)
90 ->setMethods([
'setHeader'])
91 ->getMockForAbstractClass();
96 'request' => $this->requestMock,
97 'view' => $this->viewMock,
98 'response' => $this->responseMock
102 \
Magento\Email\Controller\Adminhtml\Email\Template\Preview::class,
104 'context' => $this->context,
◆ testExecute()
Definition at line 109 of file PreviewTest.php.
111 $this->viewMock->expects($this->once())
113 ->willReturn($this->pageMock);
114 $this->pageMock->expects($this->once())
115 ->method(
'getConfig')
116 ->willReturn($this->pageConfigMock);
117 $this->pageConfigMock->expects($this->once())
119 ->willReturn($this->pageTitleMock);
120 $this->pageTitleMock->expects($this->once())
123 $this->responseMock->expects($this->once())
124 ->method(
'setHeader')
125 ->with(
'Content-Security-Policy',
"script-src 'none'");
127 $this->assertNull($this->object->execute());
◆ $context
◆ $object
◆ $pageConfigMock
◆ $pageMock
◆ $pageTitleMock
◆ $requestMock
◆ $responseMock
◆ $viewMock
The documentation for this class was generated from the following file:
- vendor/magento/module-email/Test/Unit/Controller/Adminhtml/Email/Template/PreviewTest.php