public function testCurrency() { // Loop and test for ($i = 0; $i < $this->tests; $i++) { // Build value $value = rand($this->start, $this->end) / 100; // Setup $currency = new Currency($this->exchange, new RuntimeFormat()); // Assert it $this->assertEquals('£' . number_format($value, 2), $currency->convert($value)->from('GBP')->to('GBP')->format()); } }
public function testGBPtoUSDCurrency() { // Variables $rate = $this->exchange->get('USD'); // Loop and test for ($i = 0; $i < $this->tests; $i++) { // Build value $value = rand($this->start, $this->end) / 100; // Setup $currency = new Currency($this->exchange, new RuntimeFormat()); // Assert it $this->assertEquals('$' . number_format($value * $rate, 2), $currency->convert($value)->from('GBP')->to('USD')->format()); } }