Skip to content

Commit 27b0b2b

Browse files
author
Paliarush, Alexander(apaliarush)
committed
Merge pull request #341 from magento-api/develop
[API] Sprint 49 – Test Coverage and Bugs
2 parents 8fd210d + 7c5177d commit 27b0b2b

File tree

54 files changed

+3128
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3128
-254
lines changed

app/code/Magento/Backend/Block/Dashboard.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,22 @@ protected function _prepareLayout()
3131

3232
$this->addChild('sales', 'Magento\Backend\Block\Dashboard\Sales');
3333

34-
if ($this->_scopeConfig->getValue(self::XML_PATH_ENABLE_CHARTS, \Magento\Store\Model\ScopeInterface::SCOPE_STORE)) {
34+
$isChartEnabled = $this->_scopeConfig->getValue(
35+
self::XML_PATH_ENABLE_CHARTS,
36+
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
37+
);
38+
if ($isChartEnabled) {
3539
$block = $this->getLayout()->createBlock('Magento\Backend\Block\Dashboard\Diagrams');
3640
} else {
3741
$block = $this->getLayout()->createBlock(
3842
'Magento\Backend\Block\Template'
3943
)->setTemplate(
4044
'dashboard/graph/disabled.phtml'
4145
)->setConfigUrl(
42-
$this->getUrl('adminhtml/system_config/edit', ['section' => 'admin'])
46+
$this->getUrl(
47+
'adminhtml/system_config/edit',
48+
['section' => 'admin', '_fragment' => 'admin_dashboard-link']
49+
)
4350
);
4451
}
4552
$this->setChild('diagrams', $block);

app/code/Magento/Backend/Model/Auth.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function getCredentialStorage()
145145
public function login($username, $password)
146146
{
147147
if (empty($username) || empty($password)) {
148-
self::throwException(__('Please correct the user name or password.'));
148+
self::throwException(__('You did not sign in correctly or your account is temporarily disabled.'));
149149
}
150150

151151
try {
@@ -162,7 +162,7 @@ public function login($username, $password)
162162
}
163163

164164
if (!$this->getAuthStorage()->getUser()) {
165-
self::throwException(__('Please correct the user name or password.'));
165+
self::throwException(__('You did not sign in correctly or your account is temporarily disabled.'));
166166
}
167167
} catch (PluginAuthenticationException $e) {
168168
$this->_eventManager->dispatch(
@@ -175,7 +175,9 @@ public function login($username, $password)
175175
'backend_auth_user_login_failed',
176176
['user_name' => $username, 'exception' => $e]
177177
);
178-
self::throwException(__($e->getMessage()? : 'Please correct the user name or password.'));
178+
self::throwException(
179+
__($e->getMessage()? : 'You did not sign in correctly or your account is temporarily disabled.')
180+
);
179181
}
180182
}
181183

app/code/Magento/Backend/Test/Unit/Model/AuthTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function setUp()
5050

5151
/**
5252
* @expectedException \Magento\Framework\Exception\AuthenticationException
53-
* @expectedExceptionMessage Please correct the user name or password.
53+
* @expectedExceptionMessage You did not sign in correctly or your account is temporarily disabled.
5454
*/
5555
public function testLoginFailed()
5656
{
@@ -59,8 +59,9 @@ public function testLoginFailed()
5959
->method('create')
6060
->with('Magento\Backend\Model\Auth\Credential\StorageInterface')
6161
->will($this->returnValue($this->_credentialStorage));
62-
$exceptionMock =
63-
new \Magento\Framework\Exception\LocalizedException(__('Please correct the user name or password.'));
62+
$exceptionMock = new \Magento\Framework\Exception\LocalizedException(
63+
__('You did not sign in correctly or your account is temporarily disabled.')
64+
);
6465
$this->_credentialStorage
6566
->expects($this->once())
6667
->method('login')

app/code/Magento/Backend/i18n/de_DE.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Synchronizing...,Synchronizing...
287287
"Current Month","Current Month"
288288
YTD,YTD
289289
2YTD,2YTD
290-
"Please correct the user name or password.","Please correct the user name or password."
290+
"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled."
291291
"Authentication error occurred.","Authentication error occurred."
292292
"Please specify the admin custom URL.","Please specify the admin custom URL."
293293
"Invalid %1. %2","Invalid %1. %2"

app/code/Magento/Backend/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Synchronizing...,Synchronizing...
287287
"Current Month","Current Month"
288288
YTD,YTD
289289
2YTD,2YTD
290-
"Please correct the user name or password.","Please correct the user name or password."
290+
"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled."
291291
"Authentication error occurred.","Authentication error occurred."
292292
"Please specify the admin custom URL.","Please specify the admin custom URL."
293293
"Invalid %1. %2","Invalid %1. %2"

app/code/Magento/Backend/i18n/es_ES.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Synchronizing...,Synchronizing...
287287
"Current Month","Current Month"
288288
YTD,YTD
289289
2YTD,2YTD
290-
"Please correct the user name or password.","Please correct the user name or password."
290+
"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled."
291291
"Authentication error occurred.","Authentication error occurred."
292292
"Please specify the admin custom URL.","Please specify the admin custom URL."
293293
"Invalid %1. %2","Invalid %1. %2"

app/code/Magento/Backend/i18n/fr_FR.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Synchronizing...,Synchronizing...
287287
"Current Month","Current Month"
288288
YTD,YTD
289289
2YTD,2YTD
290-
"Please correct the user name or password.","Please correct the user name or password."
290+
"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled."
291291
"Authentication error occurred.","Authentication error occurred."
292292
"Please specify the admin custom URL.","Please specify the admin custom URL."
293293
"Invalid %1. %2","Invalid %1. %2"

app/code/Magento/Backend/i18n/nl_NL.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Synchronizing...,Synchronizing...
287287
"Current Month","Current Month"
288288
YTD,YTD
289289
2YTD,2YTD
290-
"Please correct the user name or password.","Please correct the user name or password."
290+
"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled."
291291
"Authentication error occurred.","Authentication error occurred."
292292
"Please specify the admin custom URL.","Please specify the admin custom URL."
293293
"Invalid %1. %2","Invalid %1. %2"

app/code/Magento/Backend/i18n/pt_BR.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Synchronizing...,Synchronizing...
287287
"Current Month","Current Month"
288288
YTD,YTD
289289
2YTD,2YTD
290-
"Please correct the user name or password.","Please correct the user name or password."
290+
"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled."
291291
"Authentication error occurred.","Authentication error occurred."
292292
"Please specify the admin custom URL.","Please specify the admin custom URL."
293293
"Invalid %1. %2","Invalid %1. %2"

app/code/Magento/Backend/i18n/zh_CN.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Synchronizing...,Synchronizing...
287287
"Current Month","Current Month"
288288
YTD,YTD
289289
2YTD,2YTD
290-
"Please correct the user name or password.","Please correct the user name or password."
290+
"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled."
291291
"Authentication error occurred.","Authentication error occurred."
292292
"Please specify the admin custom URL.","Please specify the admin custom URL."
293293
"Invalid %1. %2","Invalid %1. %2"

0 commit comments

Comments
 (0)