File tree 7 files changed +61
-55
lines changed
Catalog/view/adminhtml/web/js
Swatches/view/adminhtml/web/css 7 files changed +61
-55
lines changed Original file line number Diff line number Diff line change @@ -39,23 +39,20 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $objectMan
39
39
*/
40
40
public function create ($ timestamp , $ type )
41
41
{
42
- $ backupId = $ timestamp . '_ ' . $ type ;
43
42
$ fsCollection = $ this ->_objectManager ->get (\Magento \Backup \Model \Fs \Collection::class);
44
43
$ backupInstance = $ this ->_objectManager ->get (\Magento \Backup \Model \Backup::class);
44
+
45
45
foreach ($ fsCollection as $ backup ) {
46
- if ($ backup ->getId () == $ backupId ) {
47
- $ backupInstance ->setType (
48
- $ backup ->getType ()
49
- )->setTime (
50
- $ backup ->getTime ()
51
- )->setName (
52
- $ backup ->getName ()
53
- )->setPath (
54
- $ backup ->getPath ()
55
- );
46
+ if ($ backup ->getTime () === (int ) $ timestamp && $ backup ->getType () === $ type ) {
47
+ $ backupInstance ->setData (['id ' => $ backup ->getId ()])
48
+ ->setType ($ backup ->getType ())
49
+ ->setTime ($ backup ->getTime ())
50
+ ->setName ($ backup ->getName ())
51
+ ->setPath ($ backup ->getPath ());
56
52
break ;
57
53
}
58
54
}
55
+
59
56
return $ backupInstance ;
60
57
}
61
58
}
Original file line number Diff line number Diff line change @@ -77,42 +77,29 @@ protected function setUp()
77
77
78
78
public function testCreate ()
79
79
{
80
- $ this ->_backupModel ->expects (
81
- $ this ->once ()
82
- )->method (
83
- 'setType '
84
- )->with (
85
- $ this ->_data ['type ' ]
86
- )->will (
87
- $ this ->returnSelf ()
88
- );
89
- $ this ->_backupModel ->expects (
90
- $ this ->once ()
91
- )->method (
92
- 'setTime '
93
- )->with (
94
- $ this ->_data ['time ' ]
95
- )->will (
96
- $ this ->returnSelf ()
97
- );
98
- $ this ->_backupModel ->expects (
99
- $ this ->once ()
100
- )->method (
101
- 'setName '
102
- )->with (
103
- $ this ->_data ['name ' ]
104
- )->will (
105
- $ this ->returnSelf ()
106
- );
107
- $ this ->_backupModel ->expects (
108
- $ this ->once ()
109
- )->method (
110
- 'setPath '
111
- )->with (
112
- $ this ->_data ['path ' ]
113
- )->will (
114
- $ this ->returnSelf ()
115
- );
80
+ $ this ->_backupModel ->expects ($ this ->once ())
81
+ ->method ('setType ' )
82
+ ->with ($ this ->_data ['type ' ])
83
+ ->will ($ this ->returnSelf ());
84
+
85
+ $ this ->_backupModel ->expects ($ this ->once ())
86
+ ->method ('setTime ' )
87
+ ->with ($ this ->_data ['time ' ])
88
+ ->will ($ this ->returnSelf ());
89
+
90
+ $ this ->_backupModel ->expects ($ this ->once ())
91
+ ->method ('setName ' )
92
+ ->with ($ this ->_data ['name ' ])
93
+ ->will ($ this ->returnSelf ());
94
+
95
+ $ this ->_backupModel ->expects ($ this ->once ())
96
+ ->method ('setPath ' )
97
+ ->with ($ this ->_data ['path ' ])
98
+ ->will ($ this ->returnSelf ());
99
+
100
+ $ this ->_backupModel ->expects ($ this ->once ())
101
+ ->method ('setData ' )
102
+ ->will ($ this ->returnSelf ());
116
103
117
104
$ this ->_instance ->create ('1385661590 ' , 'snapshot ' );
118
105
}
Original file line number Diff line number Diff line change @@ -103,11 +103,6 @@ define([
103
103
104
104
if ( component ) {
105
105
component . visible ( visible ) ;
106
-
107
- /*eslint-disable max-depth */
108
- if ( _ . isFunction ( component . clear ) ) {
109
- component . clear ( ) ;
110
- }
111
106
}
112
107
}
113
108
} , this ) ;
Original file line number Diff line number Diff line change @@ -232,6 +232,8 @@ public function createEmptyCart()
232
232
$ quote ->setShippingAddress ($ this ->quoteAddressFactory ->create ());
233
233
234
234
try {
235
+ $ quote ->getShippingAddress ()->setCollectShippingRates (true );
236
+
235
237
$ this ->quoteRepository ->save ($ quote );
236
238
} catch (\Exception $ e ) {
237
239
throw new CouldNotSaveException (__ ('Cannot create quote ' ));
Original file line number Diff line number Diff line change @@ -131,6 +131,11 @@ class QuoteManagementTest extends \PHPUnit\Framework\TestCase
131
131
*/
132
132
private $ addressRepositoryMock ;
133
133
134
+ /**
135
+ * @var \PHPUnit_Framework_MockObject_MockObject
136
+ */
137
+ private $ quoteFactoryMock ;
138
+
134
139
/**
135
140
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
136
141
*/
@@ -241,10 +246,15 @@ public function testCreateEmptyCartAnonymous()
241
246
242
247
$ quoteMock = $ this ->createMock (\Magento \Quote \Model \Quote::class);
243
248
244
- $ quoteAddress = $ this ->createMock (\Magento \Quote \Model \Quote \Address::class);
249
+ $ quoteAddress = $ this ->getMockBuilder (\Magento \Quote \Model \Quote \Address::class)
250
+ ->disableOriginalConstructor ()
251
+ ->setMethods (['setCollectShippingRates ' ])
252
+ ->getMock ();
245
253
246
254
$ quoteMock ->expects ($ this ->any ())->method ('setBillingAddress ' )->with ($ quoteAddress )->willReturnSelf ();
247
255
$ quoteMock ->expects ($ this ->any ())->method ('setShippingAddress ' )->with ($ quoteAddress )->willReturnSelf ();
256
+ $ quoteMock ->expects ($ this ->any ())->method ('getShippingAddress ' )->willReturn ($ quoteAddress );
257
+ $ quoteAddress ->expects ($ this ->once ())->method ('setCollectShippingRates ' )->with (true );
248
258
249
259
$ this ->quoteAddressFactory ->expects ($ this ->any ())->method ('create ' )->willReturn ($ quoteAddress );
250
260
Original file line number Diff line number Diff line change @@ -1166,18 +1166,29 @@ public function getCurrentUrl($fromStore = true)
1166
1166
if (!$ this ->isUseStoreInUrl ()) {
1167
1167
$ storeParsedQuery ['___store ' ] = $ this ->getCode ();
1168
1168
}
1169
+
1169
1170
if ($ fromStore !== false ) {
1170
1171
$ storeParsedQuery ['___from_store ' ] = $ fromStore ===
1171
1172
true ? $ this ->_storeManager ->getStore ()->getCode () : $ fromStore ;
1172
1173
}
1173
1174
1175
+ $ requestStringParts = explode ('? ' , $ requestString , 2 );
1176
+ $ requestStringPath = $ requestStringParts [0 ];
1177
+ if (isset ($ requestStringParts [1 ])) {
1178
+ parse_str ($ requestStringParts [1 ], $ requestString );
1179
+ } else {
1180
+ $ requestString = [];
1181
+ }
1182
+
1183
+ $ currentUrlQueryParams = array_merge ($ requestString , $ storeParsedQuery );
1184
+
1174
1185
$ currentUrl = $ storeParsedUrl ['scheme ' ]
1175
1186
. ':// '
1176
1187
. $ storeParsedUrl ['host ' ]
1177
1188
. (isset ($ storeParsedUrl ['port ' ]) ? ': ' . $ storeParsedUrl ['port ' ] : '' )
1178
1189
. $ storeParsedUrl ['path ' ]
1179
- . $ requestString
1180
- . ($ storeParsedQuery ? '? ' . http_build_query ($ storeParsedQuery , '' , '& ' ) : '' );
1190
+ . $ requestStringPath
1191
+ . ($ currentUrlQueryParams ? '? ' . http_build_query ($ currentUrlQueryParams , '' , '& ' ) : '' );
1181
1192
1182
1193
return $ currentUrl ;
1183
1194
}
Original file line number Diff line number Diff line change 3
3
* See COPYING.txt for license details.
4
4
*/
5
5
6
+ # swatch-visual-options-panel {
7
+ overflow : visible;
8
+ }
9
+
6
10
.swatch_sub-menu_container {
7
11
position : absolute;
8
12
z-index : 9999 ;
You can’t perform that action at this time.
0 commit comments