Пример #1
0
 public function it_can_be_registered()
 {
     $product = Product::register('123456', 'Some product', 1);
     \PHPUnit_Framework_Assert::assertEquals('123456', $product->product_number);
     \PHPUnit_Framework_Assert::assertEquals('Some product', $product->description);
     \PHPUnit_Framework_Assert::assertEquals(1, $product->product_type_id);
 }
Пример #2
0
 /**
  * Execute the command.
  *
  * @param ProductRepository $products
  * @return Product
  */
 public function handle(ProductRepository $products)
 {
     $product = Product::register($this->product_number, $this->description, $this->product_type_id);
     $products->save($product);
     return $product;
 }