@@ -28,7 +28,7 @@ private function _postAlert($alert = null)
2828 $ alert = factory (\App \Models \Alert::class)->make ();
2929 }
3030
31- return $ this ->json ('POST ' , '/v1 /alerts ' , [
31+ return $ this ->json ('POST ' , '/ ' . config ( ' app.api_version ' ) . ' /alerts ' , [
3232 'country ' => $ alert ->country_code ,
3333 'language ' => $ alert ->language_code ,
3434 'event ' => $ alert ->event ,
@@ -56,7 +56,7 @@ public function test_rss_feed_returns_alerts_filtered_by_severity()
5656
5757 $ alert = Alert::find ($ alert ->json ('id ' ));
5858
59- $ response = $ this ->call ('GET ' , '/v1 /alerts/rss ' , [
59+ $ response = $ this ->call ('GET ' , '/ ' . config ( ' app.api_version ' ) . ' /alerts/rss ' , [
6060 'severity ' => $ alert ->severity ,
6161 ]);
6262
@@ -68,7 +68,7 @@ public function test_rss_feed_returns_alerts_filtered_by_severity()
6868 $ this ->assertEquals ($ alert ->getPublicUrl (), (string )$ item [0 ]);
6969
7070 // Load the xml from disk
71- $ path = storage_path ('app/public/v1 /alerts/cap12/ ' ) . $ alert ->getXmlPath ();
71+ $ path = storage_path ('app/public/ ' . config ( ' app.api_version ' ) . ' /alerts/cap12/ ' ) . $ alert ->getXmlPath ();
7272 $ this ->assertFileExists ($ path );
7373
7474 $ cap = simplexml_load_file ($ path );
@@ -86,7 +86,7 @@ public function test_rss_feed_returns_alerts_filtered_by_event_type()
8686
8787 $ response = $ this ->call (
8888 'GET ' ,
89- '/v1 /org/ ' . strtolower ($ alert ->organisation ->country_code ) . '/alerts/rss ' ,
89+ '/ ' . config ( ' app.api_version ' ) . ' /org/ ' . strtolower ($ alert ->organisation ->country_code ) . '/alerts/rss ' ,
9090 ['eventType ' => $ alert ->event ]
9191 );
9292
@@ -104,7 +104,7 @@ public function test_json_feed_returns_alerts_filtered_by_event_type()
104104
105105 $ response = $ this ->call (
106106 'GET ' ,
107- '/v1 /org/ ' . strtolower ($ alert ->organisation ->country_code ) . '/alerts ' ,
107+ '/ ' . config ( ' app.api_version ' ) . ' /org/ ' . strtolower ($ alert ->organisation ->country_code ) . '/alerts ' ,
108108 ['eventType ' => $ alert ->event ]
109109 );
110110
@@ -115,7 +115,7 @@ public function test_json_feed_returns_alerts_filtered_by_event_type()
115115
116116 public function test_json_feed_returns_alerts_filtered_by_severity ()
117117 {
118- $ response = $ this ->call ('GET ' , '/v1 /alerts ' , [
118+ $ response = $ this ->call ('GET ' , '/ ' . config ( ' app.api_version ' ) . ' /alerts ' , [
119119 'severity ' => 'extreme ' ,
120120 ]);
121121
@@ -134,7 +134,7 @@ public function test_rss_item_link_self_reference_permalink_is_true()
134134
135135 $ alert = Alert::find ($ alert ->json ('id ' ));
136136
137- $ response = $ this ->call ('GET ' , '/v1 /alerts/rss ' );
137+ $ response = $ this ->call ('GET ' , '/ ' . config ( ' app.api_version ' ) . ' /alerts/rss ' );
138138
139139 $ xml = new SimpleXMLElement ($ response ->content ());
140140 $ item = $ xml ->xpath ('//rss/channel/item[1]/guid/@isPermaLink ' );
@@ -158,7 +158,7 @@ public function test_active_filter_returns_only_active_alerts()
158158
159159 $ response = $ this ->call (
160160 'GET ' ,
161- '/v1 /alerts/rss ' ,
161+ '/ ' . config ( ' app.api_version ' ) . ' /alerts/rss ' ,
162162 ['active ' => 'true ' ]
163163 );
164164
@@ -187,7 +187,7 @@ public function test_feed_returns_active_and_inactive_alerts_when_active_filter_
187187
188188 $ response = $ this ->call (
189189 'GET ' ,
190- '/v1 /alerts/rss '
190+ '/ ' . config ( ' app.api_version ' ) . ' /alerts/rss '
191191 );
192192
193193 $ xml = new SimpleXMLElement ($ response ->content ());
@@ -211,7 +211,7 @@ public function test_date_filter_return_alerts_sent_within_specified_range()
211211 // Request last 24 hrs of alerts
212212 $ response = $ this ->call (
213213 'GET ' ,
214- '/v1 /alerts/rss ' ,
214+ '/ ' . config ( ' app.api_version ' ) . ' /alerts/rss ' ,
215215 [
216216 'startTime ' => (new DateTime ('now ' ))->sub (new DateInterval ('PT24H ' ))->format ('c ' ),
217217 'endTime ' => (new DateTime ('now ' ))->format ('c ' ),
@@ -236,7 +236,7 @@ public function test_date_filter_excludes_alerts_sent_outside_specified_range()
236236 // Request alerts up to 24hrs old
237237 $ response = $ this ->call (
238238 'GET ' ,
239- '/v1 /alerts/rss ' ,
239+ '/ ' . config ( ' app.api_version ' ) . ' /alerts/rss ' ,
240240 [
241241 'startTime ' => (new DateTime ('now ' ))->sub (new DateInterval ('PT24H ' ))->format ('c ' ),
242242 'endTime ' => (new DateTime ('now ' ))->format ('c ' ),
0 commit comments