Skip to content

Commit c13f570

Browse files
author
Ann Beeskau
committed
Merge branch 'mainline-develop' into CICD-1572
2 parents aaff49c + b08dd71 commit c13f570

File tree

365 files changed

+9006
-3623
lines changed

Some content is hidden

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

365 files changed

+9006
-3623
lines changed

CHANGELOG.md

Lines changed: 101 additions & 91 deletions
Large diffs are not rendered by default.

Gruntfile.js

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,24 @@ module.exports = function (grunt) {
88
'use strict';
99

1010
var _ = require('underscore'),
11-
path = require('path');
11+
path = require('path'),
12+
configDir = './dev/tools/grunt/configs',
13+
taskDir = './dev/tools/grunt/tasks';
1214

13-
require('./dev/tools/grunt/tasks/mage-minify')(grunt);
14-
require('time-grunt')(grunt);
15+
[
16+
taskDir + '/mage-minify',
17+
taskDir + '/deploy',
18+
'time-grunt'
19+
].forEach(function (task) {
20+
require(task)(grunt);
21+
});
1522

1623
require('load-grunt-config')(grunt, {
17-
configPath: path.join(process.cwd(), 'dev/tools/grunt/configs'),
24+
configPath: path.join(__dirname, configDir),
1825
init: true,
1926
loadGruntTasks: {
2027
pattern: [
21-
'grunt-*',
22-
'!grunt-template-jasmine-requirejs'
28+
'grunt-*'
2329
]
2430
}
2531
});
@@ -78,24 +84,6 @@ module.exports = function (grunt) {
7884
'clean:pub'
7985
],
8086

81-
spec: [
82-
'specRunner:lib',
83-
'specRunner:backend',
84-
'specRunner:frontend'
85-
],
86-
87-
unit: [
88-
'jasmine:lib-unit',
89-
'jasmine:backend-unit',
90-
'jasmine:frontend-unit'
91-
],
92-
93-
integration: [
94-
'jasmine:lib-integration',
95-
'jasmine:backend-integration',
96-
'jasmine:frontend-integration'
97-
],
98-
9987
'legacy-build': [
10088
'mage-minify:legacy'
10189
],
@@ -104,7 +92,15 @@ module.exports = function (grunt) {
10492
'usebanner:documentationCss',
10593
'usebanner:documentationLess',
10694
'usebanner:documentationHtml'
107-
]
95+
],
96+
97+
spec: function (theme) {
98+
var runner = require('./dev/tests/js/jasmine/spec_runner');
99+
100+
runner.init(grunt, { theme: theme });
101+
102+
grunt.task.run(runner.getTasks());
103+
}
108104
}, function (task, name) {
109105
grunt.registerTask(name, task);
110106
});

app/code/Magento/AdminNotification/composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"description": "N/A",
44
"require": {
55
"php": "~5.5.0|~5.6.0",
6-
"magento/module-store": "0.74.0-beta1",
7-
"magento/module-backend": "0.74.0-beta1",
8-
"magento/module-media-storage": "0.74.0-beta1",
9-
"magento/framework": "0.74.0-beta1",
6+
"magento/module-store": "0.74.0-beta2",
7+
"magento/module-backend": "0.74.0-beta2",
8+
"magento/module-media-storage": "0.74.0-beta2",
9+
"magento/framework": "0.74.0-beta2",
1010
"lib-libxml": "*",
1111
"magento/magento-composer-installer": "*"
1212
},
1313
"type": "magento2-module",
14-
"version": "0.74.0-beta1",
14+
"version": "0.74.0-beta2",
1515
"license": [
1616
"OSL-3.0",
1717
"AFL-3.0"

app/code/Magento/Authorization/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"description": "Authorization module provides access to Magento ACL functionality.",
44
"require": {
55
"php": "~5.5.0|~5.6.0",
6-
"magento/module-backend": "0.74.0-beta1",
7-
"magento/framework": "0.74.0-beta1",
6+
"magento/module-backend": "0.74.0-beta2",
7+
"magento/framework": "0.74.0-beta2",
88
"magento/magento-composer-installer": "*"
99
},
1010
"type": "magento2-module",
11-
"version": "0.74.0-beta1",
11+
"version": "0.74.0-beta2",
1212
"license": [
1313
"OSL-3.0",
1414
"AFL-3.0"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public function setAuthStorage($storage)
9393
* If auth storage was not defined outside - returns default object of auth storage
9494
*
9595
* @return \Magento\Backend\Model\Auth\StorageInterface
96+
* @codeCoverageIgnore
9697
*/
9798
public function getAuthStorage()
9899
{
@@ -126,6 +127,7 @@ protected function _initCredentialStorage()
126127
* Return credential storage object
127128
*
128129
* @return null|\Magento\Backend\Model\Auth\Credential\StorageInterface
130+
* @codeCoverageIgnore
129131
*/
130132
public function getCredentialStorage()
131133
{

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ public function processLogout()
253253
* @param string $path
254254
* @return bool
255255
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
256+
* @codeCoverageIgnore
256257
*/
257258
public function isValidForPath($path)
258259
{

app/code/Magento/Backend/Model/Search/Order.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,7 @@ public function load()
7676
'id' => 'order/1/' . $order->getId(),
7777
'type' => __('Order'),
7878
'name' => __('Order #%1', $order->getIncrementId()),
79-
'description' => $order->getBillingFirstname() . ' ' . $order->getBillingLastname(),
80-
'form_panel_title' => __(
81-
'Order #%1 (%2)',
82-
$order->getIncrementId(),
83-
$order->getBillingFirstname() . ' ' . $order->getBillingLastname()
84-
),
79+
'description' => $order->getFirstname() . ' ' . $order->getLastname(),
8580
'url' => $this->_adminhtmlData->getUrl('sales/order/view', ['order_id' => $order->getId()]),
8681
];
8782
}

app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php

Lines changed: 105 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ class SessionTest extends \PHPUnit_Framework_TestCase
3838
*/
3939
protected $storage;
4040

41+
/**
42+
* @var \Magento\Framework\Acl\Builder | \PHPUnit_Framework_MockObject_MockObject
43+
*/
44+
protected $aclBuilder;
45+
4146
/**
4247
* @var Session
4348
*/
@@ -61,14 +66,23 @@ protected function setUp()
6166
'',
6267
false
6368
);
64-
$this->storage = $this->getMock('Magento\Framework\Session\Storage', ['getUser'], [], '', false);
69+
$this->storage = $this->getMock(
70+
'Magento\Framework\Session\Storage',
71+
['getUser', 'getAcl', 'setAcl'],
72+
[],
73+
'',
74+
false
75+
);
6576
$this->sessionConfig = $this->getMock(
6677
'Magento\Framework\Session\Config',
6778
['getCookiePath', 'getCookieDomain', 'getCookieSecure', 'getCookieHttpOnly'],
6879
[],
6980
'',
7081
false
7182
);
83+
$this->aclBuilder = $this->getMockBuilder('Magento\Framework\Acl\Builder')
84+
->disableOriginalConstructor()
85+
->getMock();
7286
$objectManager = new ObjectManager($this);
7387
$this->session = $objectManager->getObject(
7488
'Magento\Backend\Model\Auth\Session',
@@ -77,7 +91,8 @@ protected function setUp()
7791
'sessionConfig' => $this->sessionConfig,
7892
'cookieManager' => $this->cookieManager,
7993
'cookieMetadataFactory' => $this->cookieMetadataFactory,
80-
'storage' => $this->storage
94+
'storage' => $this->storage,
95+
'aclBuilder' => $this->aclBuilder
8196
]
8297
);
8398
}
@@ -89,6 +104,40 @@ protected function tearDown()
89104
$this->session = null;
90105
}
91106

107+
/**
108+
* @dataProvider refreshAclDataProvider
109+
* @param $isUserPassedViaParams
110+
*/
111+
public function testRefreshAcl($isUserPassedViaParams)
112+
{
113+
$aclMock = $this->getMockBuilder('Magento\Framework\Acl')->disableOriginalConstructor()->getMock();
114+
$this->aclBuilder->expects($this->any())->method('getAcl')->willReturn($aclMock);
115+
$userMock = $this->getMockBuilder('Magento\User\Model\User')
116+
->setMethods(['getReloadAclFlag', 'setReloadAclFlag', 'unsetData', 'save'])
117+
->disableOriginalConstructor()
118+
->getMock();
119+
$userMock->expects($this->any())->method('getReloadAclFlag')->willReturn(true);
120+
$userMock->expects($this->once())->method('setReloadAclFlag')->with('0')->willReturnSelf();
121+
$userMock->expects($this->once())->method('save');
122+
$this->storage->expects($this->once())->method('setAcl')->with($aclMock);
123+
$this->storage->expects($this->any())->method('getAcl')->willReturn($aclMock);
124+
if ($isUserPassedViaParams) {
125+
$this->session->refreshAcl($userMock);
126+
} else {
127+
$this->storage->expects($this->once())->method('getUser')->willReturn($userMock);
128+
$this->session->refreshAcl();
129+
}
130+
$this->assertSame($aclMock, $this->session->getAcl());
131+
}
132+
133+
public function refreshAclDataProvider()
134+
{
135+
return [
136+
'User set via params' => [true],
137+
'User set to session object' => [false]
138+
];
139+
}
140+
92141
public function testIsLoggedInPositive()
93142
{
94143
$lifetime = 900;
@@ -176,4 +225,58 @@ public function testProlong()
176225

177226
$this->assertLessThanOrEqual(time(), $this->session->getUpdatedAt());
178227
}
228+
229+
/**
230+
* @dataProvider isAllowedDataProvider
231+
* @param bool $isUserDefined
232+
* @param bool $isAclDefined
233+
* @param bool $isAllowed
234+
* @param true $expectedResult
235+
*/
236+
public function testIsAllowed($isUserDefined, $isAclDefined, $isAllowed, $expectedResult)
237+
{
238+
$userAclRole = 'userAclRole';
239+
if ($isAclDefined) {
240+
$aclMock = $this->getMockBuilder('Magento\Framework\Acl')->disableOriginalConstructor()->getMock();
241+
$this->storage->expects($this->any())->method('getAcl')->willReturn($aclMock);
242+
}
243+
if ($isUserDefined) {
244+
$userMock = $this->getMockBuilder('Magento\User\Model\User')->disableOriginalConstructor()->getMock();
245+
$this->storage->expects($this->once())->method('getUser')->willReturn($userMock);
246+
}
247+
if ($isAclDefined && $isUserDefined) {
248+
$userMock->expects($this->any())->method('getAclRole')->willReturn($userAclRole);
249+
$aclMock->expects($this->once())->method('isAllowed')->with($userAclRole)->willReturn($isAllowed);
250+
}
251+
252+
$this->assertEquals($expectedResult, $this->session->isAllowed('resource'));
253+
}
254+
255+
public function isAllowedDataProvider()
256+
{
257+
return [
258+
"Negative: User not defined" => [false, true, true, false],
259+
"Negative: Acl not defined" => [true, false, true, false],
260+
"Negative: Permission denied" => [true, true, false, false],
261+
"Positive: Permission granted" => [true, true, false, false],
262+
];
263+
}
264+
265+
/**
266+
* @dataProvider firstPageAfterLoginDataProvider
267+
* @param bool $isFirstPageAfterLogin
268+
*/
269+
public function testFirstPageAfterLogin($isFirstPageAfterLogin)
270+
{
271+
$this->session->setIsFirstPageAfterLogin($isFirstPageAfterLogin);
272+
$this->assertEquals($isFirstPageAfterLogin, $this->session->isFirstPageAfterLogin());
273+
}
274+
275+
public function firstPageAfterLoginDataProvider()
276+
{
277+
return [
278+
'First page after login' => [true],
279+
'Not first page after login' => [false],
280+
];
281+
}
179282
}

app/code/Magento/Backend/composer.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@
33
"description": "N/A",
44
"require": {
55
"php": "~5.5.0|~5.6.0",
6-
"magento/module-store": "0.74.0-beta1",
7-
"magento/module-directory": "0.74.0-beta1",
8-
"magento/module-developer": "0.74.0-beta1",
9-
"magento/module-eav": "0.74.0-beta1",
10-
"magento/module-cron": "0.74.0-beta1",
11-
"magento/module-theme": "0.74.0-beta1",
12-
"magento/module-reports": "0.74.0-beta1",
13-
"magento/module-sales": "0.74.0-beta1",
14-
"magento/module-quote": "0.74.0-beta1",
15-
"magento/module-catalog": "0.74.0-beta1",
16-
"magento/module-user": "0.74.0-beta1",
17-
"magento/module-backup": "0.74.0-beta1",
18-
"magento/module-customer": "0.74.0-beta1",
19-
"magento/module-translation": "0.74.0-beta1",
20-
"magento/module-require-js": "0.74.0-beta1",
21-
"magento/module-config": "0.74.0-beta1",
22-
"magento/framework": "0.74.0-beta1",
6+
"magento/module-store": "0.74.0-beta2",
7+
"magento/module-directory": "0.74.0-beta2",
8+
"magento/module-developer": "0.74.0-beta2",
9+
"magento/module-eav": "0.74.0-beta2",
10+
"magento/module-cron": "0.74.0-beta2",
11+
"magento/module-theme": "0.74.0-beta2",
12+
"magento/module-reports": "0.74.0-beta2",
13+
"magento/module-sales": "0.74.0-beta2",
14+
"magento/module-quote": "0.74.0-beta2",
15+
"magento/module-catalog": "0.74.0-beta2",
16+
"magento/module-user": "0.74.0-beta2",
17+
"magento/module-backup": "0.74.0-beta2",
18+
"magento/module-customer": "0.74.0-beta2",
19+
"magento/module-translation": "0.74.0-beta2",
20+
"magento/module-require-js": "0.74.0-beta2",
21+
"magento/module-config": "0.74.0-beta2",
22+
"magento/framework": "0.74.0-beta2",
2323
"magento/magento-composer-installer": "*"
2424
},
2525
"type": "magento2-module",
26-
"version": "0.74.0-beta1",
26+
"version": "0.74.0-beta2",
2727
"license": [
2828
"OSL-3.0",
2929
"AFL-3.0"

app/code/Magento/Backend/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<default>
1010
<dev>
1111
<template>
12-
<minify_html>1</minify_html>
12+
<minify_html>0</minify_html>
1313
</template>
1414
</dev>
1515
<system>

app/code/Magento/Backup/composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
"description": "N/A",
44
"require": {
55
"php": "~5.5.0|~5.6.0",
6-
"magento/module-store": "0.74.0-beta1",
7-
"magento/module-backend": "0.74.0-beta1",
8-
"magento/module-cron": "0.74.0-beta1",
9-
"magento/framework": "0.74.0-beta1",
6+
"magento/module-store": "0.74.0-beta2",
7+
"magento/module-backend": "0.74.0-beta2",
8+
"magento/module-cron": "0.74.0-beta2",
9+
"magento/framework": "0.74.0-beta2",
1010
"magento/magento-composer-installer": "*"
1111
},
1212
"type": "magento2-module",
13-
"version": "0.74.0-beta1",
13+
"version": "0.74.0-beta2",
1414
"license": [
1515
"OSL-3.0",
1616
"AFL-3.0"

0 commit comments

Comments
 (0)