This repository was archived by the owner on Jan 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,26 @@ public function testAddingInputWithNameDoesNotInjectNameInInput()
242242 $ this ->assertEquals ('foo ' , $ foo ->getName (), 'Input name should not change ' );
243243 }
244244
245+ /**
246+ * @dataProvider inputProvider
247+ */
248+ public function testReplace ($ input , $ inputName , $ expectedInput )
249+ {
250+ $ inputFilter = new InputFilter ();
251+ $ nameToReplace = 'replace_me ' ;
252+ $ inputToReplace = new Input ($ nameToReplace );
253+
254+ $ inputFilter ->add ($ inputToReplace );
255+ $ currentNumberOfFilters = count ($ inputFilter );
256+
257+ $ return = $ inputFilter ->replace ($ input , $ nameToReplace );
258+ $ this ->assertSame ($ inputFilter , $ return , 'replace() must return it self ' );
259+ $ this ->assertCount ($ currentNumberOfFilters , $ inputFilter , "Number of filters shouldn't change " );
260+
261+ $ returnInput = $ inputFilter ->get ($ nameToReplace );
262+ $ this ->assertEquals ($ expectedInput , $ returnInput , 'get() does not match the expected input ' );
263+ }
264+
245265 public function getInputFilter ()
246266 {
247267 $ filter = new InputFilter ();
You can’t perform that action at this time.
0 commit comments