File tree 2 files changed +19
-6
lines changed
Test/Unit/Ui/Component/Listing/Filter
Ui/Component/Listing/Filter
2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 19
19
use Magento \Ui \Component \Filters \FilterModifier ;
20
20
use Magento \Ui \Component \Filters \Type \Input ;
21
21
use Magento \Ui \Model \ColorPicker \ColorModesProvider ;
22
+ use Magento \Ui \View \Element \BookmarkContextInterface ;
22
23
use PHPUnit \Framework \MockObject \MockObject ;
23
24
use PHPUnit \Framework \TestCase ;
24
25
@@ -95,14 +96,21 @@ private function createObject(array $data, ContextInterface $context): Color
95
96
$ this ->filterBuilder = $ this ->createMock (FilterBuilder::class);
96
97
$ this ->filterModifier = $ this ->createMock (FilterModifier::class);
97
98
$ this ->colorModesProvider = $ this ->createMock (ColorModesProvider::class);
99
+
100
+ $ bookmarkContextMock = $ this ->getMockForAbstractClass (
101
+ BookmarkContextInterface::class
102
+ );
103
+ $ bookmarkContextMock ->expects ($ this ->once ())->method ('getFilterData ' );
104
+
98
105
return new Color (
99
106
$ context ,
100
107
$ this ->uiComponentFactory ,
101
108
$ this ->filterBuilder ,
102
109
$ this ->filterModifier ,
103
110
$ this ->colorModesProvider ,
104
111
[],
105
- $ data
112
+ $ data ,
113
+ $ bookmarkContextMock
106
114
);
107
115
}
108
116
@@ -230,10 +238,12 @@ public function colorPickerModeProvider(): array
230
238
{
231
239
return [
232
240
[
233
- 'full ' , '#21ffff '
241
+ 'full ' ,
242
+ '#21ffff '
234
243
],
235
244
[
236
- null , '#ffffff '
245
+ null ,
246
+ '#ffffff '
237
247
]
238
248
];
239
249
}
Original file line number Diff line number Diff line change 16
16
use Magento \Ui \Component \Filters \Type \AbstractFilter ;
17
17
use Magento \Ui \Component \Filters \Type \Input ;
18
18
use Magento \Ui \Component \Form \Element \ColorPicker ;
19
- use Magento \Ui \Component \Form \Element \Input as ElementInput ;
20
19
use Magento \Ui \Model \ColorPicker \ColorModesProvider ;
20
+ use Magento \Ui \View \Element \BookmarkContextInterface ;
21
21
22
22
/**
23
23
* Color grid filter
@@ -42,6 +42,7 @@ class Color extends AbstractFilter
42
42
* @param ColorModesProvider $modesProvider
43
43
* @param array $components
44
44
* @param array $data
45
+ * @param BookmarkContextInterface|null $bookmarkContext
45
46
*/
46
47
public function __construct (
47
48
ContextInterface $ context ,
@@ -50,7 +51,8 @@ public function __construct(
50
51
FilterModifier $ filterModifier ,
51
52
ColorModesProvider $ modesProvider ,
52
53
array $ components = [],
53
- array $ data = []
54
+ array $ data = [],
55
+ BookmarkContextInterface $ bookmarkContext = null
54
56
) {
55
57
$ this ->modesProvider = $ modesProvider ;
56
58
parent ::__construct (
@@ -59,7 +61,8 @@ public function __construct(
59
61
$ filterBuilder ,
60
62
$ filterModifier ,
61
63
$ components ,
62
- $ data
64
+ $ data ,
65
+ $ bookmarkContext
63
66
);
64
67
}
65
68
You can’t perform that action at this time.
0 commit comments