/** * @covers OpenBuildings\Monetary\Source_Static::exchange_rates */ public function test_exchange_rates() { $source = new M\Source_Static(); $exchange_rates = $source->exchange_rates(); $this->assertArrayHasKey('USD', $exchange_rates); $this->assertArrayHasKey('BGN', $exchange_rates); $this->assertArrayHasKey('GBP', $exchange_rates); $this->assertArrayHasKey('EUR', $exchange_rates); $this->assertArrayHasKey('JPY', $exchange_rates); }
/** * @dataProvider data_rate * @covers OpenBuildings\Monetary\Source::rate */ public function test_rate($currency_data, $from, $to, $expected_rate) { $source = new M\Source_Static($currency_data); $this->assertSame($expected_rate, $source->rate($from, $to)); }