File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change 2323class ConnectionTest extends \PHPUnit_Framework_TestCase
2424{
2525 /**
26- * @var \ OpenWeatherMap
26+ * @var OpenWeatherMap
2727 */
2828 protected $ owm ;
2929
3030 protected function setUp ()
3131 {
32-
33- // Load the app configuration
34- $ ini = parse_ini_file (__DIR__ . '/ApiKey.ini ' );
35- $ apiKey = $ ini ['api_key ' ];
36-
3732 $ this ->owm = new OpenWeatherMap ();
3833 }
3934
4035 public function testUnauthorizedAccess ()
4136 {
4237 try {
43- $ weather = $ this ->owm ->getWeather ('Paris ' );
38+ $ this ->owm ->getWeather ('Paris ' );
4439 } catch (OWMException $ e ) {
4540 $ this ->assertEquals (401 , $ e ->getCode ());
4641 $ this ->assertRegExp ('/^Invalid API key/ ' , $ e ->getMessage ());
Original file line number Diff line number Diff line change 2323class CurrentWeatherTest extends \PHPUnit_Framework_TestCase
2424{
2525 /**
26- * @var \ OpenWeatherMap
26+ * @var OpenWeatherMap
2727 */
2828 protected $ owm ;
2929
3030 protected function setUp ()
3131 {
32-
3332 // Load the app configuration
3433 $ ini = parse_ini_file (__DIR__ . '/ApiKey.ini ' );
3534 $ apiKey = $ ini ['api_key ' ];
@@ -64,7 +63,7 @@ public function testCityNotFound()
6463 {
6564 // City doesn't exist
6665 try {
67- $ weather = $ this ->owm ->getWeather ('InvalidCity ' );
66+ $ this ->owm ->getWeather ('InvalidCity ' );
6867 } catch (OWMException $ e ) {
6968 $ this ->assertEquals (404 , $ e ->getCode ());
7069 $ this ->assertEquals ('Error: Not found city ' , $ e ->getMessage ());
You can’t perform that action at this time.
0 commit comments