/** * @covers Jam_Price::humanize */ public function test_humanize() { $monetary = new OpenBuildings\Monetary\Monetary('GBP', new OpenBuildings\Monetary\Source_Static()); $price1 = new Jam_Price(13.234, 'GBP', $monetary); $price2 = new Jam_Price(5, 'GBP', $monetary); $price3 = new Jam_Price(8.5, 'EUR', $monetary); $this->assertSame('£13.23', $price1->humanize()); $this->assertSame('$7.93', $price2->humanize('USD')); $this->assertSame('€8.50', $price3->humanize()); $price1->display_currency('EUR'); $this->assertSame('€15.76', $price1->humanize()); }