]> git.mxchange.org Git - friendica-addons.git/blob - curweather/vendor/cmfcmf/openweathermap-php-api/tests/Fetcher/CurlFetcherTest.php
added composer.json and needed libs
[friendica-addons.git] / curweather / vendor / cmfcmf / openweathermap-php-api / tests / Fetcher / CurlFetcherTest.php
1 <?php
2 /**
3  * OpenWeatherMap-PHP-API — A php api to parse weather data from http://www.OpenWeatherMap.org .
4  *
5  * @license MIT
6  *
7  * Please see the LICENSE file distributed with this source code for further
8  * information regarding copyright and licensing.
9  *
10  * Please visit the following links to read about the usage policies and the license of
11  * OpenWeatherMap before using this class:
12  *
13  * @see http://www.OpenWeatherMap.org
14  * @see http://www.OpenWeatherMap.org/terms
15  * @see http://openweathermap.org/appid
16  */
17
18 namespace Cmfcmf\OpenWeatherMap\Tests\Fetcher;
19
20 use \Cmfcmf\OpenWeatherMap\Fetcher\CurlFetcher;
21
22 /**
23  * @requires function curl_version
24  */
25 class CurlFetcherTest extends \PHPUnit_Framework_TestCase
26 {
27     public function testInvalidUrl()
28     {
29         $fetcher = new CurlFetcher();
30
31         $content = $fetcher->fetch('http://notexisting.example.com');
32
33         $this->assertSame(false, $content);
34     }
35
36     public function testEmptyUrl()
37     {
38         $fetcher = new CurlFetcher();
39
40         $content = $fetcher->fetch('');
41
42         $this->assertSame(false, $content);
43     }
44
45     public function testValidUrl()
46     {
47         $fetcher = new CurlFetcher();
48
49         $content = $fetcher->fetch('http://httpbin.org/html');
50
51         $this->assertContains('Herman Melville', $content);
52     }
53 }