File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed
Test/Unit/Ui/Component/Listing/Filter
Ui/Component/Listing/Filter Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 1919use Magento \Ui \Component \Filters \FilterModifier ;
2020use Magento \Ui \Component \Filters \Type \Input ;
2121use Magento \Ui \Model \ColorPicker \ColorModesProvider ;
22+ use Magento \Ui \View \Element \BookmarkContextInterface ;
2223use PHPUnit \Framework \MockObject \MockObject ;
2324use PHPUnit \Framework \TestCase ;
2425
@@ -95,14 +96,21 @@ private function createObject(array $data, ContextInterface $context): Color
9596 $ this ->filterBuilder = $ this ->createMock (FilterBuilder::class);
9697 $ this ->filterModifier = $ this ->createMock (FilterModifier::class);
9798 $ this ->colorModesProvider = $ this ->createMock (ColorModesProvider::class);
99+
100+ $ bookmarkContextMock = $ this ->getMockForAbstractClass (
101+ BookmarkContextInterface::class
102+ );
103+ $ bookmarkContextMock ->expects ($ this ->once ())->method ('getFilterData ' );
104+
98105 return new Color (
99106 $ context ,
100107 $ this ->uiComponentFactory ,
101108 $ this ->filterBuilder ,
102109 $ this ->filterModifier ,
103110 $ this ->colorModesProvider ,
104111 [],
105- $ data
112+ $ data ,
113+ $ bookmarkContextMock
106114 );
107115 }
108116
@@ -230,10 +238,12 @@ public function colorPickerModeProvider(): array
230238 {
231239 return [
232240 [
233- 'full ' , '#21ffff '
241+ 'full ' ,
242+ '#21ffff '
234243 ],
235244 [
236- null , '#ffffff '
245+ null ,
246+ '#ffffff '
237247 ]
238248 ];
239249 }
Original file line number Diff line number Diff line change 1616use Magento \Ui \Component \Filters \Type \AbstractFilter ;
1717use Magento \Ui \Component \Filters \Type \Input ;
1818use Magento \Ui \Component \Form \Element \ColorPicker ;
19- use Magento \Ui \Component \Form \Element \Input as ElementInput ;
2019use Magento \Ui \Model \ColorPicker \ColorModesProvider ;
20+ use Magento \Ui \View \Element \BookmarkContextInterface ;
2121
2222/**
2323 * Color grid filter
@@ -42,6 +42,7 @@ class Color extends AbstractFilter
4242 * @param ColorModesProvider $modesProvider
4343 * @param array $components
4444 * @param array $data
45+ * @param BookmarkContextInterface|null $bookmarkContext
4546 */
4647 public function __construct (
4748 ContextInterface $ context ,
@@ -50,7 +51,8 @@ public function __construct(
5051 FilterModifier $ filterModifier ,
5152 ColorModesProvider $ modesProvider ,
5253 array $ components = [],
53- array $ data = []
54+ array $ data = [],
55+ BookmarkContextInterface $ bookmarkContext = null
5456 ) {
5557 $ this ->modesProvider = $ modesProvider ;
5658 parent ::__construct (
@@ -59,7 +61,8 @@ public function __construct(
5961 $ filterBuilder ,
6062 $ filterModifier ,
6163 $ components ,
62- $ data
64+ $ data ,
65+ $ bookmarkContext
6366 );
6467 }
6568
You can’t perform that action at this time.
0 commit comments