Skip to content

Commit

Permalink
Add more weather plugin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
avdg committed Jul 28, 2011
1 parent a39d7bc commit cf316ac
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 0 deletions.
72 changes: 72 additions & 0 deletions Tests/Phergie/Plugin/Weather/_files/silverSpring/conditions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This document is intended only for use by authorized licensees of The -->
<!-- Weather Channel. Unauthorized use is prohibited. Copyright 1995-2011, -->
<!-- The Weather Channel Interactive, Inc. All Rights Reserved. -->
<weather ver="2.0">
<head>
<locale>en_US</locale>
<form>MEDIUM</form>
<ut>F</ut>
<ud>mi</ud>
<us>mph</us>
<up>in</up>
<ur>in</ur>
</head>
<loc id="20904">
<dnam>Silver Spring, MD (20904)</dnam>
<tm>6:37 PM</tm>
<lat>39.07</lat>
<lon>-76.98</lon>
<sunr>6:03 AM</sunr>
<suns>8:25 PM</suns>
<zone>-4</zone>
</loc>
<lnks type="prmo">
<link pos="1">
<l>http://www.weather.com/allergies?par=xoap&amp;site=textlink&amp;cm_ven=XOAP&amp;cm_cat=TextLink&amp;cm_pla=Link1&amp;cm_ite=Allergies</l>
<t>Local Pollen Reports</t>
</link>
<link pos="2">
<l>http://www.weather.com/flights?par=xoap&amp;site=textlink&amp;cm_ven=XOAP&amp;cm_cat=TextLink&amp;cm_pla=Link2&amp;cm_ite=BusinessTraveler</l>
<t>Airport Conditions</t>
</link>
<link pos="3">
<l>http://www.weather.com/garden?par=xoap&amp;site=textlink&amp;cm_ven=XOAP&amp;cm_cat=TextLink&amp;cm_pla=Link3&amp;cm_ite=Garden</l>
<t>Lawn and Garden Weather</t>
</link>
<link pos="4">
<l>http://www.weather.com/traffic?par=xoap&amp;site=textlink&amp;cm_ven=XOAP&amp;cm_cat=TextLink&amp;cm_pla=Link4&amp;cm_ite=Traffic</l>
<t>Rush Hour Traffic</t>
</link>
</lnks>
<cc>
<lsup>7/26/11 6:25 PM EDT</lsup>
<obst>College Park, MD</obst>
<tmp>95</tmp>
<flik>93</flik>
<t>Fair</t>
<icon>34</icon>
<bar>
<r>29.71</r>
<d>steady</d>
</bar>
<wind>
<s>7</s>
<gust>16</gust>
<d>190</d>
<t>S</t>
</wind>
<hmid>23</hmid>
<vis>10.0</vis>
<uv>
<i>1</i>
<t>Low</t>
</uv>
<dewp>52</dewp>
<moon>
<icon>25</icon>
<t>Waning Crescent</t>
</moon>
</cc>
</weather>

21 changes: 21 additions & 0 deletions Tests/Phergie/Plugin/Weather/_files/silverSpring/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

return array(
'unit' => 'f',
'temperature' => 35,
'weatherReport' =>
'nick: Weather for Silver Spring, MD (20904) - '
. 'Temperature: 95F/35C, Humidity: 23%, Conditions: Fair, Updated: '
. '7/26/11 6:25 PM EDT [ http://weather.com/weather/today/20904 ]',
'response' => array(
array(
'isError' => false,
),
array(
'isError' => false,
),
array(
'isError' => false,
),
),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This document is intended only for use by authorized licensees of The -->
<!-- Weather Channel. Unauthorized use is prohibited. Copyright 1995-2011, -->
<!-- The Weather Channel Interactive, Inc. All Rights Reserved. -->
<search ver="3.0">
<loc id="20904" type="4">Silver Spring, MD (20904)</loc>
</search>

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This document is intended only for use by authorized licensees of The -->
<!-- Weather Channel. Unauthorized use is prohibited. Copyright 1995-2011, -->
<!-- The Weather Channel Interactive, Inc. All Rights Reserved. -->
<search ver="3.0" />

1 change: 1 addition & 0 deletions Tests/Phergie/Plugin/WeatherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ public function dataProviderWeatherReports()
{
return array(
array('atlanta', 'atlanta'),
array('silverSpring', '20904'),
);
}
}

0 comments on commit cf316ac

Please sign in to comment.