コード例 #1
0
 public function __construct()
 {
     /** @var CurrencyExchange\Uri\UriGet */
     $uri = UriFactory::factory(HttpRequest::HTTP_GET);
     $uri->setTemplateUri('http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency={%FROMCURRENCY%}&ToCurrency={%TOCURRENCY%}');
     // Istantiates and initializes HttpClient and Uri objects
     parent::__construct($uri);
 }
コード例 #2
0
 public function __construct()
 {
     /** @var CurrencyExchange\Uri\UriGet */
     $uri = UriFactory::factory(HttpRequest::HTTP_GET);
     $uri->setTemplateUri('http://download.finance.yahoo.com/d/quotes.csv?s={%FROMCURRENCY%}{%TOCURRENCY%}=X&f=sl1d1t1ba&e=.csv');
     // Istantiates and initializes HttpClient and Uri objects
     parent::__construct($uri);
 }
コード例 #3
0
 public function __construct()
 {
     /** @var CurrencyExchange\Uri\UriGet */
     $uri = UriFactory::factory(HttpRequest::HTTP_GET);
     $uri->setTemplateUri('http://currencies.apps.grandtrunk.net/getlatest/{%FROMCURRENCY%}/{%TOCURRENCY%}');
     // Istantiates and initializes HttpClient and Uri objects
     parent::__construct($uri);
 }
コード例 #4
0
 /**
  * @dataProvider providerTestUriFactoryReturnsInstanceOfUriAbstract
  */
 public function testUriFactoryReturnsInstanceOfUriAbstract($service)
 {
     $instance = UriFactory::factory($service);
     return $this->assertInstanceOf('\\CurrencyExchange\\Uri\\UriAbstract', $instance);
 }