Skip to content

Instantly share code, notes, and snippets.

@tilhom
Created October 12, 2015 05:49
Show Gist options
  • Save tilhom/2864744f340be8a4c49e to your computer and use it in GitHub Desktop.
Save tilhom/2864744f340be8a4c49e to your computer and use it in GitHub Desktop.
test.php
<?php
require(__DIR__ .'/db.php');
require(__DIR__ .'/CurrencyGrabber.php');
//fot test method MyCurrencyGrabberInterface::convert()
$from = 'USD';
$to = 'UZS';
$symbol = 'uzs';
header('Content-Type: text/html; charset=utf-8');
$db = Megagroup\Db::getInstance();
$testObj = new Megagroup\MyCurrencyGrabber($db);
foreach ((new Megagroup\MyCurrencyGrabber) as $c) {
echo $c['nominal'].' '.$c['charcode'].' - '.$c['value'].' RUB'.PHP_EOL;
}
//if ($testObj->download()) echo ' Okay download ';
echo $testObj->convert($from,$to);
echo "<br>";
//echo "{$testObj->get($symbol)}";
var_dump($testObj->get($symbol));
$db->close();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment