@@ -93,11 +93,39 @@ public function test_it_configures_custom_audience_for_authenticated_task_if_con
9393 $ this ->assertSame ($ expect , $ task ->getHttpRequest ()->getOidcToken ()->getAudience ());
9494 }
9595
96+ public function provider_task_url ()
97+ {
98+ return [
99+ 'just from config, no query ' => [
100+ [],
101+ "https://my.handler.foo/something " ,
102+ ],
103+ 'from config, with CreateTaskOptions.query ' => [
104+ ['query ' => ['id ' => 15 , 'scope ' => 'any ' ]],
105+ "https://my.handler.foo/something?id=15&scope=any " ,
106+ ],
107+ 'with CreateTaskOptions.custom_handler_url and no query ' => [
108+ ['custom_handler_url ' => 'https://my-handler.com/whatever ' ],
109+ "https://my-handler.com/whatever " ,
110+ ],
111+ 'with CreateTaskOptions.custom_handler_url including own query and no query ' => [
112+ ['custom_handler_url ' => 'https://my-handler.com/whatever?foo=bar ' ],
113+ "https://my-handler.com/whatever?foo=bar " ,
114+ ],
115+ 'with CreateTaskOptions.custom_handler_url and CreateTaskOptions.query ' => [
116+ [
117+ 'custom_handler_url ' => 'https://my-handler.com/whatever ' ,
118+ 'query ' => ['id ' => 15 , 'scope ' => 'any ' ],
119+ ],
120+ "https://my-handler.com/whatever?id=15&scope=any " ,
121+ ],
122+ ];
123+ }
124+
96125 /**
97- * @testWith [[], "https://my.handler.foo/something"]
98- * [{"query": {"id": 15, "scope": "any"}}, "https://my.handler.foo/something?id=15&scope=any"]
126+ * @dataProvider provider_task_url
99127 */
100- public function test_it_sets_task_to_post_to_provided_url_optionally_adding_query_params ($ opts , $ expect )
128+ public function test_it_sets_task_to_post_to_custom_or_config_url_optionally_adding_query_params ($ opts , $ expect )
101129 {
102130 $ this ->task_config = TaskTypeConfigStub::withTaskType (
103131 'do-something ' ,
0 commit comments