mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-10-09 00:12:59 +00:00
added composer.json and needed libs
This commit is contained in:
parent
4f1fb007c5
commit
1f74d409a2
42 changed files with 4413 additions and 0 deletions
53
curweather/vendor/cmfcmf/openweathermap-php-api/tests/Fetcher/CurlFetcherTest.php
vendored
Normal file
53
curweather/vendor/cmfcmf/openweathermap-php-api/tests/Fetcher/CurlFetcherTest.php
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
/**
|
||||
* OpenWeatherMap-PHP-API — A php api to parse weather data from http://www.OpenWeatherMap.org .
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* Please see the LICENSE file distributed with this source code for further
|
||||
* information regarding copyright and licensing.
|
||||
*
|
||||
* Please visit the following links to read about the usage policies and the license of
|
||||
* OpenWeatherMap before using this class:
|
||||
*
|
||||
* @see http://www.OpenWeatherMap.org
|
||||
* @see http://www.OpenWeatherMap.org/terms
|
||||
* @see http://openweathermap.org/appid
|
||||
*/
|
||||
|
||||
namespace Cmfcmf\OpenWeatherMap\Tests\Fetcher;
|
||||
|
||||
use \Cmfcmf\OpenWeatherMap\Fetcher\CurlFetcher;
|
||||
|
||||
/**
|
||||
* @requires function curl_version
|
||||
*/
|
||||
class CurlFetcherTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testInvalidUrl()
|
||||
{
|
||||
$fetcher = new CurlFetcher();
|
||||
|
||||
$content = $fetcher->fetch('http://notexisting.example.com');
|
||||
|
||||
$this->assertSame(false, $content);
|
||||
}
|
||||
|
||||
public function testEmptyUrl()
|
||||
{
|
||||
$fetcher = new CurlFetcher();
|
||||
|
||||
$content = $fetcher->fetch('');
|
||||
|
||||
$this->assertSame(false, $content);
|
||||
}
|
||||
|
||||
public function testValidUrl()
|
||||
{
|
||||
$fetcher = new CurlFetcher();
|
||||
|
||||
$content = $fetcher->fetch('http://httpbin.org/html');
|
||||
|
||||
$this->assertContains('Herman Melville', $content);
|
||||
}
|
||||
}
|
59
curweather/vendor/cmfcmf/openweathermap-php-api/tests/Fetcher/FileGetContentsFetcherTest.php
vendored
Normal file
59
curweather/vendor/cmfcmf/openweathermap-php-api/tests/Fetcher/FileGetContentsFetcherTest.php
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
/**
|
||||
* OpenWeatherMap-PHP-API — A php api to parse weather data from http://www.OpenWeatherMap.org .
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* Please see the LICENSE file distributed with this source code for further
|
||||
* information regarding copyright and licensing.
|
||||
*
|
||||
* Please visit the following links to read about the usage policies and the license of
|
||||
* OpenWeatherMap before using this class:
|
||||
*
|
||||
* @see http://www.OpenWeatherMap.org
|
||||
* @see http://www.OpenWeatherMap.org/terms
|
||||
* @see http://openweathermap.org/appid
|
||||
*/
|
||||
|
||||
namespace Cmfcmf\OpenWeatherMap\Tests\Fetcher;
|
||||
|
||||
use \Cmfcmf\OpenWeatherMap\Fetcher\FileGetContentsFetcher;
|
||||
|
||||
class FileGetContentsFetcherTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
if (!ini_get('allow_url_fopen')) {
|
||||
$this->markTestSkipped('"allow_url_fopen" is set to off.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \PHPUnit_Framework_Error_Warning
|
||||
*/
|
||||
public function testInvalidUrl()
|
||||
{
|
||||
$fetcher = new FileGetContentsFetcher();
|
||||
|
||||
$fetcher->fetch('http://notexisting.example.com');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \PHPUnit_Framework_Error_Warning
|
||||
*/
|
||||
public function testEmptyUrl()
|
||||
{
|
||||
$fetcher = new FileGetContentsFetcher();
|
||||
|
||||
$fetcher->fetch('');
|
||||
}
|
||||
|
||||
public function testValidUrl()
|
||||
{
|
||||
$fetcher = new FileGetContentsFetcher();
|
||||
|
||||
$content = $fetcher->fetch('http://httpbin.org/html');
|
||||
|
||||
$this->assertContains('Herman Melville', $content);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue