Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit a41b543

Browse files
committed
MAGETWO-85139: Cross-Site Request Forgery (Backups, maintenance mode) - Magento 1 & 2
1 parent 349ec44 commit a41b543

File tree

1 file changed

+5
-9
lines changed
  • app/code/Magento/Backup/Test/Unit/Controller/Adminhtml/Index

1 file changed

+5
-9
lines changed

app/code/Magento/Backup/Test/Unit/Controller/Adminhtml/Index/CreateTest.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ class CreateTest extends \PHPUnit\Framework\TestCase
6767
/**
6868
* @var \Magento\Framework\App\MaintenanceMode|\PHPUnit_Framework_MockObject_MockObject
6969
*/
70-
private $maintenanceMode;
70+
private $maintenanceModeMock;
7171

7272
/**
7373
* @var \Magento\Framework\Backup\Factory|\PHPUnit_Framework_MockObject_MockObject
7474
*/
7575
private $backupFactoryMock;
7676

7777
/**
78-
* @var \Magento\Backup\Controller\Adminhtml\Index\Create|\PHPUnit_Framework_MockObject_MockObject
78+
* @var \Magento\Backup\Controller\Adminhtml\Index\Create
7979
*/
8080
private $createController;
8181

@@ -110,7 +110,7 @@ public function setUp()
110110
->disableOriginalConstructor()
111111
->setMethods(['getExtensionByType', 'getBackupsDir'])
112112
->getMock();
113-
$this->maintenanceMode = $this->getMockBuilder(\Magento\Framework\App\MaintenanceMode::class)
113+
$this->maintenanceModeMock = $this->getMockBuilder(\Magento\Framework\App\MaintenanceMode::class)
114114
->disableOriginalConstructor()
115115
->setMethods(['set'])
116116
->getMock();
@@ -126,7 +126,7 @@ public function setUp()
126126
'response' => $this->responseMock,
127127
'session' => $this->sessionMock,
128128
'helper' => $this->dataBackendHelperMock,
129-
'maintenanceMode' => $this->maintenanceMode,
129+
'maintenanceMode' => $this->maintenanceModeMock,
130130
]
131131
);
132132
$this->createController = $this->objectManager->getObject(
@@ -154,10 +154,6 @@ public function testExecuteNotPost()
154154
$this->requestMock->expects($this->any())
155155
->method('isPost')
156156
->willReturn(false);
157-
$this->requestMock->expects($this->any())
158-
->method('getParam')
159-
->with('maintenance_mode')
160-
->willReturn(true);
161157
$this->dataBackendHelperMock->expects($this->any())
162158
->method('getUrl')
163159
->with($redirectUrl, [])
@@ -202,7 +198,7 @@ public function testExecutePermission()
202198
->method('representJson')
203199
->with($response)
204200
->willReturnSelf();
205-
$this->maintenanceMode->expects($this->any())
201+
$this->maintenanceModeMock->expects($this->any())
206202
->method('set')
207203
->with(true)
208204
->willReturn(false);

0 commit comments

Comments
 (0)