3 * OpenWeatherMap-PHP-API — A php api to parse weather data from http://www.OpenWeatherMap.org .
7 * Please see the LICENSE file distributed with this source code for further
8 * information regarding copyright and licensing.
10 * Please visit the following links to read about the usage policies and the license of
11 * OpenWeatherMap before using this class:
13 * @see http://www.OpenWeatherMap.org
14 * @see http://www.OpenWeatherMap.org/terms
15 * @see http://openweathermap.org/appid
18 namespace Cmfcmf\OpenWeatherMap\Tests\Fetcher;
20 use \Cmfcmf\OpenWeatherMap\Fetcher\CurlFetcher;
23 * @requires function curl_version
25 class CurlFetcherTest extends \PHPUnit_Framework_TestCase
27 public function testInvalidUrl()
29 $fetcher = new CurlFetcher();
31 $content = $fetcher->fetch('http://notexisting.example.com');
33 $this->assertSame(false, $content);
36 public function testEmptyUrl()
38 $fetcher = new CurlFetcher();
40 $content = $fetcher->fetch('');
42 $this->assertSame(false, $content);
45 public function testValidUrl()
47 $fetcher = new CurlFetcher();
49 $content = $fetcher->fetch('http://httpbin.org/html');
51 $this->assertContains('Herman Melville', $content);