Skip to content

Commit e29a584

Browse files
committed
Fix class extends and unit tests related to PR magento/magento2/pull/32090
1 parent 849ad61 commit e29a584

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

AdobeStockImageAdminUi/Test/Unit/Ui/Component/Listing/Filter/ColorTest.php

+13-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Magento\Ui\Component\Filters\FilterModifier;
2020
use Magento\Ui\Component\Filters\Type\Input;
2121
use Magento\Ui\Model\ColorPicker\ColorModesProvider;
22+
use Magento\Ui\View\Element\BookmarkContextInterface;
2223
use PHPUnit\Framework\MockObject\MockObject;
2324
use 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
}

AdobeStockImageAdminUi/Ui/Component/Listing/Filter/Color.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
use Magento\Ui\Component\Filters\Type\AbstractFilter;
1717
use Magento\Ui\Component\Filters\Type\Input;
1818
use Magento\Ui\Component\Form\Element\ColorPicker;
19-
use Magento\Ui\Component\Form\Element\Input as ElementInput;
2019
use 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

0 commit comments

Comments
 (0)