@@ -126,6 +126,30 @@ public function testPrepare($name, $filterData, $expectedCondition)
126
126
127
127
if ($ expectedCondition !== null ) {
128
128
$ this ->processFilters ($ name , $ filterData , $ expectedCondition , $ uiComponent );
129
+ } else {
130
+ $ uiComponent ->method ('convertDate ' )
131
+ ->willReturnMap ([
132
+ [$ filterData [$ name ]['from ' ], new \DateTime ($ filterData [$ name ]['from ' ])],
133
+ [$ filterData [$ name ]['to ' ], new \DateTime ($ filterData [$ name ]['to ' ] . ' 23:59:59 ' )],
134
+ ]);
135
+
136
+ $ this ->filterBuilderMock ->expects (static ::exactly (2 ))
137
+ ->method ('setConditionType ' )
138
+ ->willReturnSelf ();
139
+ $ this ->filterBuilderMock ->expects (static ::exactly (2 ))
140
+ ->method ('setField ' )
141
+ ->willReturnSelf ();
142
+ $ this ->filterBuilderMock ->expects (static ::exactly (2 ))
143
+ ->method ('setValue ' )
144
+ ->willReturnSelf ();
145
+
146
+ $ filterMock = $ this ->getMock (Filter::class);
147
+ $ this ->filterBuilderMock ->expects (static ::exactly (2 ))
148
+ ->method ('create ' )
149
+ ->willReturn ($ filterMock );
150
+ $ this ->dataProviderMock ->expects (static ::exactly (2 ))
151
+ ->method ('addFilter ' )
152
+ ->with ($ filterMock );
129
153
}
130
154
131
155
$ this ->uiComponentFactory ->expects ($ this ->any ())
@@ -230,8 +254,8 @@ private function processFilters($name, $filterData, $expectedCondition, $uiCompo
230
254
} else {
231
255
$ uiComponent ->method ('convertDate ' )
232
256
->willReturnMap ([
233
- [$ filterData [$ name ]['from ' ], 0 , 0 , 0 , new \DateTime ($ filterData [$ name ]['from ' ])],
234
- [$ filterData [$ name ]['to ' ], 23 , 59 , 59 , new \DateTime ($ filterData [$ name ]['to ' ] . ' 23:59:59 ' )],
257
+ [$ filterData [$ name ]['from ' ], new \DateTime ($ filterData [$ name ]['from ' ])],
258
+ [$ filterData [$ name ]['to ' ], new \DateTime ($ filterData [$ name ]['to ' ] . ' 23:59:59 ' )],
235
259
]);
236
260
}
237
261
0 commit comments