Skip to content

Commit

Permalink
Merge pull request #278 from magento-extensibility/develop
Browse files Browse the repository at this point in the history
[Extensibility] Bug fixes, public APIs, Sprint 50
  • Loading branch information
Tang, Yu(ytang1) committed May 7, 2015
2 parents 635ce44 + fa7c1fc commit a7cb0c2
Show file tree
Hide file tree
Showing 150 changed files with 2,704 additions and 1,084 deletions.
8 changes: 5 additions & 3 deletions app/code/Magento/Backend/App/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

namespace Magento\Backend\App;

use Magento\Framework\App\Config\ScopeConfigInterface;

/**
* Backend config accessor
*/
Expand All @@ -36,7 +38,7 @@ public function __construct(\Magento\Framework\App\Config\ScopePool $scopePool)
*/
public function getValue($path)
{
return $this->_scopePool->getScope(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, null)->getValue($path);
return $this->_scopePool->getScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null)->getValue($path);
}

/**
Expand All @@ -48,7 +50,7 @@ public function getValue($path)
*/
public function setValue($path, $value)
{
$this->_scopePool->getScope(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, null)->setValue($path, $value);
$this->_scopePool->getScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null)->setValue($path, $value);
}

/**
Expand All @@ -59,6 +61,6 @@ public function setValue($path, $value)
*/
public function isSetFlag($path)
{
return !!$this->_scopePool->getScope(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, null)->getValue($path);
return !!$this->_scopePool->getScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null)->getValue($path);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

namespace Magento\Backend\Block\Page\System\Config\Robots;

use Magento\Framework\App\Config\ScopeConfigInterface;

/**
* "Reset to Defaults" button renderer
*
Expand Down Expand Up @@ -50,7 +52,7 @@ protected function _construct()
public function getRobotsDefaultCustomInstructions()
{
return trim((string)$this->_scopeConfig->getValue(
self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT
self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS, ScopeConfigInterface::SCOPE_TYPE_DEFAULT
));
}

Expand Down
7 changes: 5 additions & 2 deletions app/code/Magento/Backend/Model/Auth/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ class Session extends \Magento\Framework\Session\SessionManager implements \Mage
* @param \Magento\Framework\Session\StorageInterface $storage
* @param CookieManagerInterface $cookieManager
* @param CookieMetadataFactory $cookieMetadataFactory
* @param \Magento\Framework\App\State $appState
* @param \Magento\Framework\Acl\Builder $aclBuilder
* @param \Magento\Backend\Model\UrlInterface $backendUrl
* @param \Magento\Backend\App\ConfigInterface $config
* @throws \Magento\Framework\Exception\SessionException
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
Expand All @@ -75,6 +77,7 @@ public function __construct(
\Magento\Framework\Session\StorageInterface $storage,
CookieManagerInterface $cookieManager,
CookieMetadataFactory $cookieMetadataFactory,
\Magento\Framework\App\State $appState,
\Magento\Framework\Acl\Builder $aclBuilder,
\Magento\Backend\Model\UrlInterface $backendUrl,
\Magento\Backend\App\ConfigInterface $config
Expand All @@ -90,9 +93,9 @@ public function __construct(
$validator,
$storage,
$cookieManager,
$cookieMetadataFactory
$cookieMetadataFactory,
$appState
);
$this->start();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/Model/Locale/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function switchBackendInterfaceLocale($localeCode)
*/
public function getUserInterfaceLocale()
{
$interfaceLocale = \Magento\Framework\Locale\ResolverInterface::DEFAULT_LOCALE;
$interfaceLocale = \Magento\Framework\Locale\Resolver::DEFAULT_LOCALE;

$userData = $this->_authSession->getUser();
if ($userData && $userData->getInterfaceLocale()) {
Expand Down
33 changes: 0 additions & 33 deletions app/code/Magento/Backend/Model/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,6 @@

class Session extends \Magento\Framework\Session\SessionManager
{
/**
* @param \Magento\Framework\App\Request\Http $request
* @param \Magento\Framework\Session\SidResolverInterface $sidResolver
* @param \Magento\Framework\Session\Config\ConfigInterface $sessionConfig
* @param \Magento\Framework\Session\SaveHandlerInterface $saveHandler
* @param \Magento\Framework\Session\ValidatorInterface $validator
* @param \Magento\Framework\Session\StorageInterface $storage
* @param \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager
* @param \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory
*/
public function __construct(
\Magento\Framework\App\Request\Http $request,
\Magento\Framework\Session\SidResolverInterface $sidResolver,
\Magento\Framework\Session\Config\ConfigInterface $sessionConfig,
\Magento\Framework\Session\SaveHandlerInterface $saveHandler,
\Magento\Framework\Session\ValidatorInterface $validator,
\Magento\Framework\Session\StorageInterface $storage,
\Magento\Framework\Stdlib\CookieManagerInterface $cookieManager,
\Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory
) {
parent::__construct(
$request,
$sidResolver,
$sessionConfig,
$saveHandler,
$validator,
$storage,
$cookieManager,
$cookieMetadataFactory
);
$this->start();
}

/**
* Skip path validation in backend area
*
Expand Down
7 changes: 5 additions & 2 deletions app/code/Magento/Backend/Model/Session/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ class Quote extends \Magento\Framework\Session\SessionManager
* @param \Magento\Framework\Session\StorageInterface $storage
* @param \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager
* @param \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory
* @param \Magento\Framework\App\State $appState
* @param CustomerRepositoryInterface $customerRepository
* @param \Magento\Quote\Model\QuoteRepository $quoteRepository
* @param \Magento\Sales\Model\OrderFactory $orderFactory
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param GroupManagementInterface $groupManagement
* @throws \Magento\Framework\Exception\SessionException
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
Expand All @@ -99,6 +101,7 @@ public function __construct(
\Magento\Framework\Session\StorageInterface $storage,
\Magento\Framework\Stdlib\CookieManagerInterface $cookieManager,
\Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory,
\Magento\Framework\App\State $appState,
CustomerRepositoryInterface $customerRepository,
\Magento\Quote\Model\QuoteRepository $quoteRepository,
\Magento\Sales\Model\OrderFactory $orderFactory,
Expand All @@ -118,9 +121,9 @@ public function __construct(
$validator,
$storage,
$cookieManager,
$cookieMetadataFactory
$cookieMetadataFactory,
$appState
);
$this->start();
if ($this->_storeManager->hasSingleStore()) {
$this->setStoreId($this->_storeManager->getStore(true)->getId());
}
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Backend/Model/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Url extends \Magento\Framework\Url implements \Magento\Backend\Model\UrlIn
* @param \Magento\Framework\Url\ScopeResolverInterface $scopeResolver
* @param \Magento\Framework\Session\Generic $session
* @param \Magento\Framework\Session\SidResolverInterface $sidResolver
* @param \Magento\Framework\Url\RouteParamsResolverFactory $routeParamsResolver
* @param \Magento\Framework\Url\RouteParamsResolverFactory $routeParamsResolverFactory
* @param \Magento\Framework\Url\QueryParamsResolverInterface $queryParamsResolver
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
* @param string $scopeType
Expand All @@ -105,7 +105,7 @@ public function __construct(
\Magento\Framework\Url\ScopeResolverInterface $scopeResolver,
\Magento\Framework\Session\Generic $session,
\Magento\Framework\Session\SidResolverInterface $sidResolver,
\Magento\Framework\Url\RouteParamsResolverFactory $routeParamsResolver,
\Magento\Framework\Url\RouteParamsResolverFactory $routeParamsResolverFactory,
\Magento\Framework\Url\QueryParamsResolverInterface $queryParamsResolver,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
$scopeType,
Expand All @@ -126,7 +126,7 @@ public function __construct(
$scopeResolver,
$session,
$sidResolver,
$routeParamsResolver,
$routeParamsResolverFactory,
$queryParamsResolver,
$scopeConfig,
$scopeType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
namespace Magento\Backend\Test\Unit\Model\Locale;

use Magento\Framework\Locale\Resolver;

class ManagerTest extends \PHPUnit_Framework_TestCase
{
/**
Expand Down Expand Up @@ -87,7 +89,7 @@ public function testGetUserInterfaceLocaleDefault()
{
$locale = $this->_model->getUserInterfaceLocale();

$this->assertEquals($locale, \Magento\Framework\Locale\ResolverInterface::DEFAULT_LOCALE);
$this->assertEquals($locale, Resolver::DEFAULT_LOCALE);
}

/**
Expand Down
10 changes: 9 additions & 1 deletion app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ protected function setUp()
'',
false
);
$appStateMock = $this->getMock(
'Magento\Framework\App\State',
[],
[],
'',
false
);
$this->storeManagerMock = $this->getMockForAbstractClass(
'Magento\Store\Model\StoreManagerInterface',
[],
Expand All @@ -201,11 +208,12 @@ protected function setUp()
'storage' => $this->storageMock,
'cookieManager' => $this->cookieManagerMock,
'cookieMetadataFactory' => $this->cookieMetadataFactoryMock,
'appState' => $appStateMock,
'customerRepository' => $this->customerRepositoryMock,
'quoteRepository' => $this->quoteRepositoryMock,
'orderFactory' => $this->orderFactoryMock,
'storeManager' => $this->storeManagerMock,
'groupManagement' => $this->groupManagementMock
'groupManagement' => $this->groupManagementMock,
],
'',
true
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Backend/Test/Unit/Model/UrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected function setUp()
'menuConfig' => $this->_menuConfigMock,
'authSession' => $this->_authSessionMock,
'encryptor' => $this->_encryptor,
'routeParamsResolver' => $this->_paramsResolverMock
'routeParamsResolverFactory' => $this->_paramsResolverMock
]
);
$this->_paramsResolverMock->expects(
Expand All @@ -186,7 +186,7 @@ protected function setUp()
'menuConfig' => $this->_menuConfigMock,
'authSession' => $this->_authSessionMock,
'encryptor' => $this->_encryptor,
'routeParamsResolver' => $this->_paramsResolverMock
'routeParamsResolverFactory' => $this->_paramsResolverMock
]
);

Expand Down Expand Up @@ -259,7 +259,7 @@ public function testGetAreaFrontName()
[
'backendHelper' => $helperMock,
'authSession' => $this->_authSessionMock,
'routeParamsResolver' => $this->_paramsResolverMock
'routeParamsResolverFactory' => $this->_paramsResolverMock
]
);
$urlModel->getAreaFrontName();
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backup/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
The Backup module allows administrators to perform backups and rollbacks. Types of backups include system, database and media backups. This module relies on the Cron module to schedule backups.

This module does not effect the storefront.
This module does not affect the storefront.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<arguments>
<argument name="header" xsi:type="string" translate="true">Name</argument>
<argument name="index" xsi:type="string">display_name</argument>
<argument name="filter" xsi:type="string">0</argument>
<argument name="sortable" xsi:type="string">1</argument>
<argument name="column_css_class" xsi:type="string">col-name</argument>
<argument name="header_css_class" xsi:type="string">col-name</argument>
Expand Down
Loading

0 comments on commit a7cb0c2

Please sign in to comment.