From 5180c758bc4a401b51ffe2c353509ed1cc508b2d Mon Sep 17 00:00:00 2001 From: Bryant Luk Date: Tue, 4 Aug 2015 16:27:27 -0500 Subject: [PATCH 1/6] MAGETWO-39947: Remove Autocomplete on Forms - Remove autocomplete on forms where the browser could retain sensitive information --- .../view/adminhtml/templates/admin/resetforgottenpassword.phtml | 2 +- setup/view/magento/setup/add-database.phtml | 1 + setup/view/magento/setup/create-admin-account.phtml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/User/view/adminhtml/templates/admin/resetforgottenpassword.phtml b/app/code/Magento/User/view/adminhtml/templates/admin/resetforgottenpassword.phtml index 2beb2b1a277ff..ba3d313a32886 100644 --- a/app/code/Magento/User/view/adminhtml/templates/admin/resetforgottenpassword.phtml +++ b/app/code/Magento/User/view/adminhtml/templates/admin/resetforgottenpassword.phtml @@ -8,7 +8,7 @@ ?> -
+

diff --git a/setup/view/magento/setup/add-database.phtml b/setup/view/magento/setup/add-database.phtml index 77de46a30ed12..193630700bb60 100644 --- a/setup/view/magento/setup/add-database.phtml +++ b/setup/view/magento/setup/add-database.phtml @@ -51,6 +51,7 @@ novalidate name="database" role="form" + autocomplete="off" >
Date: Tue, 4 Aug 2015 16:35:05 -0500 Subject: [PATCH 2/6] MAGETWO-40748: Change Error Message for Disabled Admin User --- app/code/Magento/User/Model/User.php | 4 +++- app/code/Magento/User/Test/Unit/Model/UserTest.php | 2 +- app/code/Magento/User/i18n/de_DE.csv | 2 +- app/code/Magento/User/i18n/en_US.csv | 2 +- app/code/Magento/User/i18n/es_ES.csv | 2 +- app/code/Magento/User/i18n/fr_FR.csv | 2 +- app/code/Magento/User/i18n/nl_NL.csv | 2 +- app/code/Magento/User/i18n/pt_BR.csv | 2 +- app/code/Magento/User/i18n/zh_CN.csv | 2 +- 9 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/User/Model/User.php b/app/code/Magento/User/Model/User.php index 744fae46c3897..117e9425be7d2 100644 --- a/app/code/Magento/User/Model/User.php +++ b/app/code/Magento/User/Model/User.php @@ -470,7 +470,9 @@ public function verifyIdentity($password) $result = false; if ($this->_encryptor->validateHash($password, $this->getPassword())) { if ($this->getIsActive() != '1') { - throw new AuthenticationException(__('This account is inactive.')); + throw new AuthenticationException( + __('You did not sign in correctly or your account is temporarily disabled.') + ); } if (!$this->hasAssigned2Role($this->getId())) { throw new AuthenticationException(__('You need more permissions to access this.')); diff --git a/app/code/Magento/User/Test/Unit/Model/UserTest.php b/app/code/Magento/User/Test/Unit/Model/UserTest.php index 33a77515ccb0b..05e2f75ad8be1 100644 --- a/app/code/Magento/User/Test/Unit/Model/UserTest.php +++ b/app/code/Magento/User/Test/Unit/Model/UserTest.php @@ -364,7 +364,7 @@ public function testVerifyIdentityInactiveRecord() $this->_model->setIsActive(false); $this->setExpectedException( 'Magento\\Framework\\Exception\\AuthenticationException', - 'This account is inactive.' + 'You did not sign in correctly or your account is temporarily disabled.' ); $this->_model->verifyIdentity($password); } diff --git a/app/code/Magento/User/i18n/de_DE.csv b/app/code/Magento/User/i18n/de_DE.csv index 7168308c5dcf0..3f27379d04352 100644 --- a/app/code/Magento/User/i18n/de_DE.csv +++ b/app/code/Magento/User/i18n/de_DE.csv @@ -85,7 +85,7 @@ Permissions,Permissions "Your password must be at least %1 characters.","Your password must be at least %1 characters." "Your password must include both numeric and alphabetic characters.","Your password must include both numeric and alphabetic characters." "Your password confirmation must match your password.","Your password confirmation must match your password." -"This account is inactive.","This account is inactive." +"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled." "Forgot your user name or password?","Forgot your user name or password?" "Retrieve Password","Retrieve Password" "Forgot your password?","Forgot your password?" diff --git a/app/code/Magento/User/i18n/en_US.csv b/app/code/Magento/User/i18n/en_US.csv index 7168308c5dcf0..3f27379d04352 100644 --- a/app/code/Magento/User/i18n/en_US.csv +++ b/app/code/Magento/User/i18n/en_US.csv @@ -85,7 +85,7 @@ Permissions,Permissions "Your password must be at least %1 characters.","Your password must be at least %1 characters." "Your password must include both numeric and alphabetic characters.","Your password must include both numeric and alphabetic characters." "Your password confirmation must match your password.","Your password confirmation must match your password." -"This account is inactive.","This account is inactive." +"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled." "Forgot your user name or password?","Forgot your user name or password?" "Retrieve Password","Retrieve Password" "Forgot your password?","Forgot your password?" diff --git a/app/code/Magento/User/i18n/es_ES.csv b/app/code/Magento/User/i18n/es_ES.csv index 7168308c5dcf0..3f27379d04352 100644 --- a/app/code/Magento/User/i18n/es_ES.csv +++ b/app/code/Magento/User/i18n/es_ES.csv @@ -85,7 +85,7 @@ Permissions,Permissions "Your password must be at least %1 characters.","Your password must be at least %1 characters." "Your password must include both numeric and alphabetic characters.","Your password must include both numeric and alphabetic characters." "Your password confirmation must match your password.","Your password confirmation must match your password." -"This account is inactive.","This account is inactive." +"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled." "Forgot your user name or password?","Forgot your user name or password?" "Retrieve Password","Retrieve Password" "Forgot your password?","Forgot your password?" diff --git a/app/code/Magento/User/i18n/fr_FR.csv b/app/code/Magento/User/i18n/fr_FR.csv index 7168308c5dcf0..3f27379d04352 100644 --- a/app/code/Magento/User/i18n/fr_FR.csv +++ b/app/code/Magento/User/i18n/fr_FR.csv @@ -85,7 +85,7 @@ Permissions,Permissions "Your password must be at least %1 characters.","Your password must be at least %1 characters." "Your password must include both numeric and alphabetic characters.","Your password must include both numeric and alphabetic characters." "Your password confirmation must match your password.","Your password confirmation must match your password." -"This account is inactive.","This account is inactive." +"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled." "Forgot your user name or password?","Forgot your user name or password?" "Retrieve Password","Retrieve Password" "Forgot your password?","Forgot your password?" diff --git a/app/code/Magento/User/i18n/nl_NL.csv b/app/code/Magento/User/i18n/nl_NL.csv index 7168308c5dcf0..3f27379d04352 100644 --- a/app/code/Magento/User/i18n/nl_NL.csv +++ b/app/code/Magento/User/i18n/nl_NL.csv @@ -85,7 +85,7 @@ Permissions,Permissions "Your password must be at least %1 characters.","Your password must be at least %1 characters." "Your password must include both numeric and alphabetic characters.","Your password must include both numeric and alphabetic characters." "Your password confirmation must match your password.","Your password confirmation must match your password." -"This account is inactive.","This account is inactive." +"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled." "Forgot your user name or password?","Forgot your user name or password?" "Retrieve Password","Retrieve Password" "Forgot your password?","Forgot your password?" diff --git a/app/code/Magento/User/i18n/pt_BR.csv b/app/code/Magento/User/i18n/pt_BR.csv index 7168308c5dcf0..3f27379d04352 100644 --- a/app/code/Magento/User/i18n/pt_BR.csv +++ b/app/code/Magento/User/i18n/pt_BR.csv @@ -85,7 +85,7 @@ Permissions,Permissions "Your password must be at least %1 characters.","Your password must be at least %1 characters." "Your password must include both numeric and alphabetic characters.","Your password must include both numeric and alphabetic characters." "Your password confirmation must match your password.","Your password confirmation must match your password." -"This account is inactive.","This account is inactive." +"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled." "Forgot your user name or password?","Forgot your user name or password?" "Retrieve Password","Retrieve Password" "Forgot your password?","Forgot your password?" diff --git a/app/code/Magento/User/i18n/zh_CN.csv b/app/code/Magento/User/i18n/zh_CN.csv index 7168308c5dcf0..3f27379d04352 100644 --- a/app/code/Magento/User/i18n/zh_CN.csv +++ b/app/code/Magento/User/i18n/zh_CN.csv @@ -85,7 +85,7 @@ Permissions,Permissions "Your password must be at least %1 characters.","Your password must be at least %1 characters." "Your password must include both numeric and alphabetic characters.","Your password must include both numeric and alphabetic characters." "Your password confirmation must match your password.","Your password confirmation must match your password." -"This account is inactive.","This account is inactive." +"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled." "Forgot your user name or password?","Forgot your user name or password?" "Retrieve Password","Retrieve Password" "Forgot your password?","Forgot your password?" From b32ec5faf5cc9ab45f5e12cbcdad18b084adf31b Mon Sep 17 00:00:00 2001 From: Cari Spruiell Date: Fri, 7 Aug 2015 12:32:24 -0500 Subject: [PATCH 3/6] MAGETWO-40317: Unvalidated Host header leaks into page - added code to clean the Host value provided in the header. --- .../Magento/Framework/App/Request/Http.php | 11 ++++++--- .../Framework/App/Test/Unit/HttpTest.php | 24 ++++++++++++++++++- .../App/Test/Unit/Request/HttpTest.php | 11 +++++++++ .../Framework/HTTP/PhpEnvironment/Request.php | 10 ++++++++ .../Test/Unit/PhpEnvironment/RequestTest.php | 8 ++++++- .../Magento/Framework/Webapi/Request.php | 7 ++++-- .../Magento/Framework/Webapi/Rest/Request.php | 4 +++- .../Webapi/Test/Unit/Rest/RequestTest.php | 6 ++++- pub/get.php | 7 +++++- 9 files changed, 78 insertions(+), 10 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Request/Http.php b/lib/internal/Magento/Framework/App/Request/Http.php index 18502821429cf..574e2be0f364f 100644 --- a/lib/internal/Magento/Framework/App/Request/Http.php +++ b/lib/internal/Magento/Framework/App/Request/Http.php @@ -1,7 +1,5 @@ routeConfig = $routeConfig; $this->pathInfoProcessor = $pathInfoProcessor; $this->objectManager = $objectManager; @@ -302,6 +306,7 @@ public function isAjax() public function getDistroBaseUrl() { $headerHttpHost = $this->getServer('HTTP_HOST'); + $headerHttpHost = $this->converter->cleanString($headerHttpHost); $headerServerPort = $this->getServer('SERVER_PORT'); $headerScriptName = $this->getServer('SCRIPT_NAME'); $headerHttps = $this->getServer('HTTPS'); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/HttpTest.php index 202cc71761b31..661488badedbe 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/HttpTest.php @@ -65,8 +65,30 @@ class HttpTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http') + $cookieReaderMock = $this->getMockBuilder('Magento\Framework\Stdlib\Cookie\CookieReaderInterface') + ->disableOriginalConstructor() + ->getMock(); + $routeConfigMock = $this->getMockBuilder('Magento\Framework\App\Route\ConfigInterface\Proxy') ->disableOriginalConstructor() + ->getMock(); + $pathInfoProcessorMock = $this->getMockBuilder('Magento\Framework\App\Request\PathInfoProcessorInterface') + ->disableOriginalConstructor() + ->getMock(); + $converterMock = $this->getMockBuilder('Magento\Framework\Stdlib\StringUtils') + ->disableOriginalConstructor() + ->setMethods(['cleanString']) + ->getMock(); + $objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http') + ->setConstructorArgs([ + 'cookieReader' => $cookieReaderMock, + 'routeConfig' => $routeConfigMock, + 'pathInfoProcessor' => $pathInfoProcessorMock, + 'objectManager' => $objectManagerMock, + 'converter' => $converterMock + ]) ->setMethods(['getFrontName']) ->getMock(); $this->areaListMock = $this->getMockBuilder('Magento\Framework\App\AreaList') diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php index 8bfb9be2f3bb2..3bd82cb2d54ec 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php @@ -36,6 +36,11 @@ class HttpTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; + /** + * @var \Magento\Framework\Stdlib\StringUtils | \PHPUnit_Framework_MockObject_MockObject + */ + protected $converterMock; + /** * @var array */ @@ -54,6 +59,11 @@ protected function setUp() $this->_infoProcessorMock = $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface'); $this->_infoProcessorMock->expects($this->any())->method('process')->will($this->returnArgument(1)); $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); + $this->converterMock = $this->getMockBuilder('Magento\Framework\Stdlib\StringUtils') + ->disableOriginalConstructor() + ->setMethods(['cleanString']) + ->getMock(); + $this->converterMock->expects($this->any())->method('cleanString')->will($this->returnArgument(0)); // Stash the $_SERVER array to protect it from modification in test $this->serverArray = $_SERVER; @@ -76,6 +86,7 @@ private function getModel($uri = null) 'routeConfig' => $this->_routerListMock, 'pathInfoProcessor' => $this->_infoProcessorMock, 'objectManager' => $this->objectManager, + 'converter' => $this->converterMock, 'uri' => $uri, ] ); diff --git a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php index 1a72b0d22cf0f..52d5b5dbdcc57 100644 --- a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php +++ b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php @@ -6,6 +6,7 @@ namespace Magento\Framework\HTTP\PhpEnvironment; use Magento\Framework\Stdlib\Cookie\CookieReaderInterface; +use Magento\Framework\Stdlib\StringUtils; use Zend\Http\Header\HeaderInterface; use Zend\Stdlib\Parameters; use Zend\Stdlib\ParametersInterface; @@ -79,12 +80,19 @@ class Request extends \Zend\Http\PhpEnvironment\Request */ protected $cookieReader; + /** + * @var StringUtils + */ + protected $converter; + /** * @param CookieReaderInterface $cookieReader + * @param StringUtils $converter * @param UriInterface|string|null $uri */ public function __construct( CookieReaderInterface $cookieReader, + StringUtils $converter, $uri = null ) { $this->cookieReader = $cookieReader; @@ -103,6 +111,7 @@ public function __construct( throw new \InvalidArgumentException('Invalid URI provided to constructor'); } } + $this->converter = $converter; parent::__construct(); } @@ -608,6 +617,7 @@ public function getHeader($name, $default = false) public function getHttpHost($trimPort = true) { $httpHost = $this->getServer('HTTP_HOST'); + $httpHost = $this->converter->cleanString($httpHost); if (empty($httpHost)) { return false; } diff --git a/lib/internal/Magento/Framework/HTTP/Test/Unit/PhpEnvironment/RequestTest.php b/lib/internal/Magento/Framework/HTTP/Test/Unit/PhpEnvironment/RequestTest.php index 1dc822ef0270a..ee39c40d3f144 100644 --- a/lib/internal/Magento/Framework/HTTP/Test/Unit/PhpEnvironment/RequestTest.php +++ b/lib/internal/Magento/Framework/HTTP/Test/Unit/PhpEnvironment/RequestTest.php @@ -26,6 +26,11 @@ class RequestTest extends \PHPUnit_Framework_TestCase */ private $cookieReader; + /** + * @var \Magento\Framework\Stdlib\StringUtils | \PHPUnit_Framework_MockObject_MockObject + */ + private $converter; + /** * @var array */ @@ -35,6 +40,7 @@ protected function setUp() { $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); $this->cookieReader = $this->getMock('Magento\Framework\Stdlib\Cookie\CookieReaderInterface'); + $this->converter = $this->getMock('Magento\Framework\Stdlib\StringUtils'); // Stash the $_SERVER array to protect it from modification in test $this->serverArray = $_SERVER; } @@ -46,7 +52,7 @@ public function tearDown() private function getModel($uri = null) { - return new Request($this->cookieReader, $uri); + return new Request($this->cookieReader, $this->converter, $uri); } public function testSetPathInfoWithNullValue() diff --git a/lib/internal/Magento/Framework/Webapi/Request.php b/lib/internal/Magento/Framework/Webapi/Request.php index fdd688a313e51..9ddd1452a0e56 100644 --- a/lib/internal/Magento/Framework/Webapi/Request.php +++ b/lib/internal/Magento/Framework/Webapi/Request.php @@ -12,24 +12,27 @@ use Magento\Framework\Config\ScopeInterface; use Magento\Framework\HTTP\PhpEnvironment\Request as HttpRequest; use Magento\Framework\Stdlib\Cookie\CookieReaderInterface; +use Magento\Framework\Stdlib\StringUtils; class Request extends HttpRequest implements RequestInterface { /** * Modify pathInfo: strip down the front name and query parameters. * + * @param CookieReaderInterface $cookieReader * @param AreaList $areaList * @param ScopeInterface $configScope - * @param CookieReaderInterface $cookieReader + * @param StringUtils $converter * @param null|string|\Zend_Uri $uri */ public function __construct( CookieReaderInterface $cookieReader, AreaList $areaList, ScopeInterface $configScope, + StringUtils $converter, $uri = null ) { - parent::__construct($cookieReader, $uri); + parent::__construct($cookieReader, $converter, $uri); $pathInfo = $this->getRequestUri(); /** Remove base url and area from path */ diff --git a/lib/internal/Magento/Framework/Webapi/Rest/Request.php b/lib/internal/Magento/Framework/Webapi/Rest/Request.php index 757f1a2729451..df1e19b50a546 100644 --- a/lib/internal/Magento/Framework/Webapi/Rest/Request.php +++ b/lib/internal/Magento/Framework/Webapi/Rest/Request.php @@ -51,6 +51,7 @@ class Request extends \Magento\Framework\Webapi\Request * @param \Magento\Framework\App\AreaList $areaList * @param \Magento\Framework\Config\ScopeInterface $configScope * @param \Magento\Framework\Webapi\Rest\Request\DeserializerFactory $deserializerFactory + * @param \Magento\Framework\Stdlib\StringUtils $converter * @param null|string $uri */ public function __construct( @@ -58,9 +59,10 @@ public function __construct( \Magento\Framework\App\AreaList $areaList, \Magento\Framework\Config\ScopeInterface $configScope, \Magento\Framework\Webapi\Rest\Request\DeserializerFactory $deserializerFactory, + \Magento\Framework\Stdlib\StringUtils $converter, $uri = null ) { - parent::__construct($cookieReader, $areaList, $configScope, $uri); + parent::__construct($cookieReader, $areaList, $configScope, $converter, $uri); $this->_deserializerFactory = $deserializerFactory; } diff --git a/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/RequestTest.php b/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/RequestTest.php index fd3ab91301ba8..29d464dbf7a9c 100644 --- a/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/RequestTest.php +++ b/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/RequestTest.php @@ -38,10 +38,14 @@ protected function setUp() /** Instantiate request. */ // TODO: Get rid of SUT mocks. $this->_cookieManagerMock = $this->getMock('Magento\Framework\Stdlib\CookieManagerInterface'); + $converterMock = $this->getMockBuilder('Magento\Framework\Stdlib\StringUtils') + ->disableOriginalConstructor() + ->setMethods(['cleanString']) + ->getMock(); $this->_request = $this->getMock( 'Magento\Framework\Webapi\Rest\Request', ['getHeader', 'getMethod', 'isGet', 'isPost', 'isPut', 'isDelete', 'getContent'], - [$this->_cookieManagerMock, $areaListMock, $configScopeMock, $this->_deserializerFactory, ] + [$this->_cookieManagerMock, $areaListMock, $configScopeMock, $this->_deserializerFactory, $converterMock] ); parent::setUp(); diff --git a/pub/get.php b/pub/get.php index 9888d7627acae..797a4a8e8e627 100644 --- a/pub/get.php +++ b/pub/get.php @@ -27,7 +27,12 @@ return $isResourceAllowed; }; -$request = new \Magento\MediaStorage\Model\File\Storage\Request(new Request(new PhpCookieReader())); +$request = new \Magento\MediaStorage\Model\File\Storage\Request( + new Request( + new PhpCookieReader(), + new Magento\Framework\Stdlib\StringUtils() + ) +); $relativePath = $request->getPathInfo(); if (file_exists($configCacheFile) && is_readable($configCacheFile)) { $config = json_decode(file_get_contents($configCacheFile), true); From ba90e45cb871fec90e493638f400fd5e740915d8 Mon Sep 17 00:00:00 2001 From: Cari Spruiell Date: Thu, 13 Aug 2015 15:18:59 -0500 Subject: [PATCH 4/6] MAGETWO-40263: Merge Branches and Stabilize Builds - fix constructor argument order --- lib/internal/Magento/Framework/App/Request/Http.php | 4 ++-- lib/internal/Magento/Framework/Webapi/Request.php | 4 ++-- lib/internal/Magento/Framework/Webapi/Rest/Request.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Request/Http.php b/lib/internal/Magento/Framework/App/Request/Http.php index 574e2be0f364f..26c41a6abc229 100644 --- a/lib/internal/Magento/Framework/App/Request/Http.php +++ b/lib/internal/Magento/Framework/App/Request/Http.php @@ -81,19 +81,19 @@ class Http extends Request implements RequestInterface /** * @param CookieReaderInterface $cookieReader + * @param StringUtils $converter * @param ConfigInterface $routeConfig * @param PathInfoProcessorInterface $pathInfoProcessor * @param ObjectManagerInterface $objectManager - * @param StringUtils $converter * @param string|null $uri * @param array $directFrontNames */ public function __construct( CookieReaderInterface $cookieReader, + StringUtils $converter, ConfigInterface $routeConfig, PathInfoProcessorInterface $pathInfoProcessor, ObjectManagerInterface $objectManager, - StringUtils $converter, $uri = null, $directFrontNames = [] ) { diff --git a/lib/internal/Magento/Framework/Webapi/Request.php b/lib/internal/Magento/Framework/Webapi/Request.php index 9ddd1452a0e56..00e60e8c1a109 100644 --- a/lib/internal/Magento/Framework/Webapi/Request.php +++ b/lib/internal/Magento/Framework/Webapi/Request.php @@ -20,16 +20,16 @@ class Request extends HttpRequest implements RequestInterface * Modify pathInfo: strip down the front name and query parameters. * * @param CookieReaderInterface $cookieReader + * @param StringUtils $converter * @param AreaList $areaList * @param ScopeInterface $configScope - * @param StringUtils $converter * @param null|string|\Zend_Uri $uri */ public function __construct( CookieReaderInterface $cookieReader, + StringUtils $converter, AreaList $areaList, ScopeInterface $configScope, - StringUtils $converter, $uri = null ) { parent::__construct($cookieReader, $converter, $uri); diff --git a/lib/internal/Magento/Framework/Webapi/Rest/Request.php b/lib/internal/Magento/Framework/Webapi/Rest/Request.php index df1e19b50a546..077701047cce6 100644 --- a/lib/internal/Magento/Framework/Webapi/Rest/Request.php +++ b/lib/internal/Magento/Framework/Webapi/Rest/Request.php @@ -48,21 +48,21 @@ class Request extends \Magento\Framework\Webapi\Request * Initialize dependencies * * @param \Magento\Framework\Stdlib\Cookie\CookieReaderInterface $cookieReader + * @param \Magento\Framework\Stdlib\StringUtils $converter * @param \Magento\Framework\App\AreaList $areaList * @param \Magento\Framework\Config\ScopeInterface $configScope * @param \Magento\Framework\Webapi\Rest\Request\DeserializerFactory $deserializerFactory - * @param \Magento\Framework\Stdlib\StringUtils $converter * @param null|string $uri */ public function __construct( \Magento\Framework\Stdlib\Cookie\CookieReaderInterface $cookieReader, + \Magento\Framework\Stdlib\StringUtils $converter, \Magento\Framework\App\AreaList $areaList, \Magento\Framework\Config\ScopeInterface $configScope, \Magento\Framework\Webapi\Rest\Request\DeserializerFactory $deserializerFactory, - \Magento\Framework\Stdlib\StringUtils $converter, $uri = null ) { - parent::__construct($cookieReader, $areaList, $configScope, $converter, $uri); + parent::__construct($cookieReader, $converter, $areaList, $configScope, $uri); $this->_deserializerFactory = $deserializerFactory; } From eb9fd5bf9ce56e2861db52dcf0c293c23c8bcace Mon Sep 17 00:00:00 2001 From: Cari Spruiell Date: Thu, 13 Aug 2015 16:18:44 -0500 Subject: [PATCH 5/6] MAGETWO-40263: Merge Branches and Stabilize Builds - fix unit test failures --- .../Test/Unit/Model/Authorization/OauthUserContextTest.php | 2 +- lib/internal/Magento/Framework/App/Test/Unit/HttpTest.php | 4 ++-- .../Magento/Framework/Webapi/Test/Unit/Rest/RequestTest.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Webapi/Test/Unit/Model/Authorization/OauthUserContextTest.php b/app/code/Magento/Webapi/Test/Unit/Model/Authorization/OauthUserContextTest.php index 3a2344bf0be68..cb6c9eee73535 100644 --- a/app/code/Magento/Webapi/Test/Unit/Model/Authorization/OauthUserContextTest.php +++ b/app/code/Magento/Webapi/Test/Unit/Model/Authorization/OauthUserContextTest.php @@ -70,7 +70,7 @@ protected function setUp() $this->oauthRequestHelper = $this->getMockBuilder('Magento\Framework\Oauth\Helper\Request') ->disableOriginalConstructor() - ->setMethods(['prepareRequest']) + ->setMethods(['prepareRequest', 'getRequestUrl']) ->getMock(); $this->oauthService = $this->getMockBuilder('Magento\Framework\Oauth\Oauth') diff --git a/lib/internal/Magento/Framework/App/Test/Unit/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/HttpTest.php index 661488badedbe..2ed892acca1ab 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/HttpTest.php @@ -84,10 +84,10 @@ public function setUp() $this->requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http') ->setConstructorArgs([ 'cookieReader' => $cookieReaderMock, + 'converter' => $converterMock, 'routeConfig' => $routeConfigMock, 'pathInfoProcessor' => $pathInfoProcessorMock, - 'objectManager' => $objectManagerMock, - 'converter' => $converterMock + 'objectManager' => $objectManagerMock ]) ->setMethods(['getFrontName']) ->getMock(); diff --git a/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/RequestTest.php b/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/RequestTest.php index 29d464dbf7a9c..b8a120e215321 100644 --- a/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/RequestTest.php +++ b/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/RequestTest.php @@ -45,7 +45,7 @@ protected function setUp() $this->_request = $this->getMock( 'Magento\Framework\Webapi\Rest\Request', ['getHeader', 'getMethod', 'isGet', 'isPost', 'isPut', 'isDelete', 'getContent'], - [$this->_cookieManagerMock, $areaListMock, $configScopeMock, $this->_deserializerFactory, $converterMock] + [$this->_cookieManagerMock, $converterMock, $areaListMock, $configScopeMock, $this->_deserializerFactory] ); parent::setUp(); From 9408602610a91700b6eec7a44db967cd5fa3fea3 Mon Sep 17 00:00:00 2001 From: Cari Spruiell Date: Thu, 13 Aug 2015 17:05:09 -0500 Subject: [PATCH 6/6] MAGETWO-40263: Merge Branches and Stabilize Builds - fix test failures --- .../framework/tests/unit/testsuite/Magento/Test/RequestTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php index b0fc84e6db46a..65cc4833c6e9f 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php @@ -18,6 +18,7 @@ protected function setUp() { $this->_model = new \Magento\TestFramework\Request( $this->getMock('Magento\Framework\Stdlib\Cookie\CookieReaderInterface'), + $this->getMock('Magento\Framework\Stdlib\StringUtils'), $this->getMock('Magento\Framework\App\Route\ConfigInterface\Proxy', [], [], '', false), $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface'), $this->getMock('Magento\Framework\ObjectManagerInterface')