Skip to content

Commit a556a93

Browse files
author
Alexander Paliarush
committed
MAGETWO-45688: Reflected XSS in Cookie HTTP header
1 parent 25b8622 commit a556a93

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/internal/Magento/Framework/Data/Test/Unit/Form/FormKeyTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ class FormKeyTest extends \PHPUnit_Framework_TestCase
2222
*/
2323
protected $sessionMock;
2424

25+
/**
26+
* @var \Zend\Escaper\Escaper|\PHPUnit_Framework_MockObject_MockObject
27+
*/
28+
protected $escaperMock;
29+
2530
/**
2631
* @var FormKey
2732
*/
@@ -32,9 +37,12 @@ protected function setUp()
3237
$this->mathRandomMock = $this->getMock('Magento\Framework\Math\Random', [], [], '', false);
3338
$methods = ['setData', 'getData'];
3439
$this->sessionMock = $this->getMock('Magento\Framework\Session\SessionManager', $methods, [], '', false);
40+
$this->escaperMock = $this->getMock('Zend\Escaper\Escaper', ['escapeHtmlAttr'], [], '', false);
41+
$this->escaperMock->expects($this->any())->method('escapeHtmlAttr')->willReturnArgument(0);
3542
$this->formKey = new FormKey(
3643
$this->mathRandomMock,
37-
$this->sessionMock
44+
$this->sessionMock,
45+
$this->escaperMock
3846
);
3947
}
4048

0 commit comments

Comments
 (0)