66namespace Magento \Ui \Test \Unit \Component \Filters \Type ;
77
88use Magento \Framework \View \Element \UiComponent \ContextInterface ;
9- use Magento \Framework \View \Element \UiComponent \ContextInterface as UiContext ;
109use Magento \Framework \View \Element \UiComponentFactory ;
1110use Magento \Framework \View \Element \UiComponentInterface ;
1211use Magento \Ui \Component \Filters \Type \Input ;
@@ -37,18 +36,18 @@ class InputTest extends \PHPUnit\Framework\TestCase
3736 protected $ filterModifierMock ;
3837
3938 /**
40- * Set up
39+ * @inheritdoc
4140 */
4241 protected function setUp ()
4342 {
4443 $ this ->contextMock = $ this ->getMockForAbstractClass (
45- \ Magento \ Framework \ View \ Element \ UiComponent \ ContextInterface::class,
44+ ContextInterface::class,
4645 [],
4746 '' ,
4847 false
4948 );
5049 $ this ->uiComponentFactory = $ this ->createPartialMock (
51- \ Magento \ Framework \ View \ Element \ UiComponentFactory::class,
50+ UiComponentFactory::class,
5251 ['create ' ]
5352 );
5453 $ this ->filterBuilderMock = $ this ->createMock (\Magento \Framework \Api \FilterBuilder::class);
@@ -63,7 +62,7 @@ protected function setUp()
6362 *
6463 * @return void
6564 */
66- public function testGetComponentName ()
65+ public function testGetComponentName (): void
6766 {
6867 $ this ->contextMock ->expects ($ this ->never ())->method ('getProcessor ' );
6968 $ date = new Input (
@@ -86,15 +85,15 @@ public function testGetComponentName()
8685 * @dataProvider getPrepareDataProvider
8786 * @return void
8887 */
89- public function testPrepare ($ name , $ filterData , $ expectedCondition )
88+ public function testPrepare (string $ name , array $ filterData , ? array $ expectedCondition ): void
9089 {
9190 $ processor = $ this ->getMockBuilder (\Magento \Framework \View \Element \UiComponent \Processor::class)
9291 ->disableOriginalConstructor ()
9392 ->getMock ();
9493 $ this ->contextMock ->expects ($ this ->atLeastOnce ())->method ('getProcessor ' )->willReturn ($ processor );
9594 /** @var UiComponentInterface $uiComponent */
9695 $ uiComponent = $ this ->getMockForAbstractClass (
97- \ Magento \ Framework \ View \ Element \ UiComponentInterface::class,
96+ UiComponentInterface::class,
9897 [],
9998 '' ,
10099 false
@@ -169,14 +168,24 @@ public function testPrepare($name, $filterData, $expectedCondition)
169168 /**
170169 * @return array
171170 */
172- public function getPrepareDataProvider ()
171+ public function getPrepareDataProvider (): array
173172 {
174173 return [
175174 [
176175 'test_date ' ,
177176 ['test_date ' => '' ],
178177 null ,
179178 ],
179+ [
180+ 'test_date ' ,
181+ ['test_date ' => null ],
182+ null ,
183+ ],
184+ [
185+ 'test_date ' ,
186+ ['test_date ' => '0 ' ],
187+ ['like ' => '%0% ' ],
188+ ],
180189 [
181190 'test_date ' ,
182191 ['test_date ' => 'some_value ' ],
0 commit comments