@@ -63,9 +63,10 @@ protected function setUp(): void
6363 *
6464 * @param string $filterType
6565 * @param string $filterName
66+ * @param bool $userDefined
6667 * @dataProvider updateDataProvider
6768 */
68- public function testUpdate (string $ filterType , string $ filterName )
69+ public function testUpdate (string $ filterType , string $ filterName, bool $ userDefined )
6970 {
7071 $ componentName = 'component_name ' ;
7172 $ componentConfig = [0 , 1 , 2 ];
@@ -75,8 +76,12 @@ public function testUpdate(string $filterType, string $filterName)
7576 ->getMockForAbstractClass ();
7677 $ columnInterface ->expects ($ this ->atLeastOnce ())
7778 ->method ('getData ' )
78- ->with ('config/filter ' )
79- ->willReturn ($ filterType );
79+ ->willReturnOnConsecutiveCalls (
80+ $ filterType ,
81+ ['userDefined ' => $ userDefined ],
82+ $ filterType ,
83+ ['userDefined ' => $ userDefined ]
84+ );
8085 $ columnInterface ->expects ($ this ->atLeastOnce ())->method ('getName ' )->willReturn ($ componentName );
8186 $ columnInterface ->expects ($ this ->once ())->method ('getConfiguration ' )->willReturn ($ componentConfig );
8287 $ filterComponent = $ this ->getMockBuilder (UiComponentInterface::class)
@@ -87,7 +92,7 @@ public function testUpdate(string $filterType, string $filterName)
8792 ->willReturnSelf ();
8893 $ filterComponent ->expects ($ this ->once ())->method ('prepare ' )->willReturnSelf ();
8994 $ this ->uiComponentFactory ->expects ($ this ->once ())->method ('create ' )
90- ->with ($ componentName , $ filterName , ['context ' => $ this ->context ])
95+ ->with ($ componentName , $ filterName , ['context ' => $ this ->context , ' userDefined ' => $ userDefined ])
9196 ->willReturn ($ filterComponent );
9297
9398 $ this ->filters ->update ($ columnInterface );
@@ -101,8 +106,8 @@ public function testUpdate(string $filterType, string $filterName)
101106 public static function updateDataProvider (): array
102107 {
103108 return [
104- ['text ' , 'filterInput ' ],
105- ['datetimeRange ' , 'filterDate ' ],
109+ ['text ' , 'filterInput ' , false ],
110+ ['datetimeRange ' , 'filterDate ' , true ],
106111 ];
107112 }
108113}
0 commit comments