@@ -49,7 +49,7 @@ public function testDoctrineEntitySearchFilter(): void
4949 $ this ->assertEquals ('bar ' , $ a ['hydra:member ' ][1 ]['foo ' ]);
5050
5151 $ this ->assertArraySubset (['hydra:search ' => [
52- 'hydra:template ' => \sprintf ('/%s{?foo,fooAlias,order[order[id]],order[order[foo]],searchPartial[foo],searchExact[foo],searchOnTextAndDate[foo],searchOnTextAndDate[createdAt][before],searchOnTextAndDate[createdAt][strictly_before],searchOnTextAndDate[createdAt][after],searchOnTextAndDate[createdAt][strictly_after],searchParameter [foo],q,id,createdAt} ' , $ route ),
52+ 'hydra:template ' => \sprintf ('/%s{?foo,fooAlias,order[order[id]],order[order[foo]],searchPartial[foo],searchExact[foo],searchOnTextAndDate[foo],searchOnTextAndDate[createdAt][before],searchOnTextAndDate[createdAt][strictly_before],searchOnTextAndDate[createdAt][after],searchOnTextAndDate[createdAt][strictly_after],searchPartialProperties[foo],searchExactProperties [foo],q,id,createdAt} ' , $ route ),
5353 ]], $ a );
5454
5555 $ this ->assertArraySubset (['@type ' => 'IriTemplateMapping ' , 'variable ' => 'fooAlias ' , 'property ' => 'foo ' ], $ a ['hydra:search ' ]['hydra:mapping ' ][1 ]);
@@ -118,14 +118,26 @@ public function testPropertyPlaceholderFilter(): void
118118 $ this ->assertEquals ($ a ['hydra:member ' ][0 ]['foo ' ], 'baz ' );
119119 }
120120
121- public function testPartialSearchFilter (): void
121+ public function testPartialSearchFilterWithProperties (): void
122122 {
123123 static ::bootKernel ();
124124 $ resource = $ this ->isMongoDB () ? SearchFilterParameterDocument::class : SearchFilterParameter::class;
125125 $ this ->recreateSchema ([$ resource ]);
126126 $ this ->loadFixtures ($ resource );
127127 $ route = 'search_filter_parameter ' ;
128- $ response = self ::createClient ()->request ('GET ' , $ route .'?searchParameter[foo]=baz ' );
128+ $ response = self ::createClient ()->request ('GET ' , $ route .'?searchPartialProperties[foo]=baz ' );
129+ $ a = $ response ->toArray ();
130+ $ this ->assertEquals ($ a ['hydra:member ' ][0 ]['foo ' ], 'baz ' );
131+ }
132+
133+ public function testExactFilterWithProperties (): void
134+ {
135+ static ::bootKernel ();
136+ $ resource = $ this ->isMongoDB () ? SearchFilterParameterDocument::class : SearchFilterParameter::class;
137+ $ this ->recreateSchema ([$ resource ]);
138+ $ this ->loadFixtures ($ resource );
139+ $ route = 'search_filter_parameter ' ;
140+ $ response = self ::createClient ()->request ('GET ' , $ route .'?searchExactProperties[foo]=baz ' );
129141 $ a = $ response ->toArray ();
130142 $ this ->assertEquals ($ a ['hydra:member ' ][0 ]['foo ' ], 'baz ' );
131143 }
0 commit comments