@@ -75,6 +75,10 @@ public function testCreate(): void
7575 $ filters ->setDirection ('abcde ' );
7676 $ this ->assertSame (\GaletteObjectsLend \Repository \Objects::ORDERBY_STATUS , $ filters ->orderby );
7777 $ this ->assertSame (\Galette \Enums \SQLOrder::DESC ->value , $ filters ->getDirection ());
78+ $ this ->expectLogEntry (
79+ \Analog::WARNING ,
80+ '[GaletteObjectsLend\Filters\ObjectsList|Pagination] "abcde" is not a valid backing value for enum Galette\Enums\SQLOrder '
81+ );
7882
7983 //change direction only
8084 $ filters ->setDirection (\Galette \Enums \SQLOrder::ASC );
@@ -89,25 +93,17 @@ public function testCreate(): void
8993 $ filters ->active_filter = \GaletteObjectsLend \Repository \Objects::INACTIVE_OBJECTS ;
9094 $ this ->assertSame (\GaletteObjectsLend \Repository \Objects::INACTIVE_OBJECTS , $ filters ->active_filter );
9195
92- //cast is forced
93- $ filters ->active_filter = (string ) \GaletteObjectsLend \Repository \Objects::INACTIVE_OBJECTS ;
94- $ this ->assertSame (\GaletteObjectsLend \Repository \Objects::INACTIVE_OBJECTS , $ filters ->active_filter );
95-
9696 //out of known values, no change
9797 $ filters ->active_filter = 42 ;
98+ $ this ->expectLogEntry (
99+ \Analog::WARNING ,
100+ '[ObjectsList] Value for active filter should be either 1, 1 or 2 (42 given) '
101+ );
98102 $ this ->assertSame (\GaletteObjectsLend \Repository \Objects::INACTIVE_OBJECTS , $ filters ->active_filter );
99103
100104 $ filters ->field_filter = \GaletteObjectsLend \Repository \Objects::FILTER_SERIAL ;
101105 $ this ->assertSame (\GaletteObjectsLend \Repository \Objects::FILTER_SERIAL , $ filters ->field_filter );
102106
103- //cast is forced
104- $ filters ->field_filter = (string ) \GaletteObjectsLend \Repository \Objects::FILTER_SERIAL ;
105- $ this ->assertSame (\GaletteObjectsLend \Repository \Objects::FILTER_SERIAL , $ filters ->field_filter );
106-
107- //non numeric value, no change
108- $ filters ->field_filter = 'abc ' ;
109- $ this ->assertSame (\GaletteObjectsLend \Repository \Objects::FILTER_SERIAL , $ filters ->field_filter );
110-
111107 //reinit and test defaults are back
112108 $ filters ->reinit ();
113109 $ this ->testDefaults ($ filters );
0 commit comments