/** * @param Product $product * * @return Price */ protected function createPriceForProduct(Product $product) : Price { $price = Price::fromSplit(random_int(1, 99), random_int(0, 99)); $product->prices()->save($price); return $price; }
/** * Should be able to get the subunits formatted. */ public function testSubUnitsFormatted() { $this->price->subunits = 5; $this->assertEquals('05', $this->price->subUnitsFormatted()); }