示例#1
0
 /**
  * @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;
 }
示例#2
0
 /**
  * Should be able to get the subunits formatted.
  */
 public function testSubUnitsFormatted()
 {
     $this->price->subunits = 5;
     $this->assertEquals('05', $this->price->subUnitsFormatted());
 }