Пример #1
0
 /**
  * @coversNothing
  */
 public function testAsserts()
 {
     $item = new ProductItem(['quantity' => -12]);
     $item->validate();
     $this->assertEquals('quantity should be greater than 0', $item->getErrors()->humanize());
     $item = new ProductItem(['quantity' => null]);
     $item->validate();
     $this->assertEquals('quantity must be present', $item->getErrors()->humanize());
     $item = new ProductItem(['quantity' => 'asd123']);
     $item->validate();
     $this->assertEquals('quantity is an invalid number, quantity should be greater than 0', $item->getErrors()->humanize());
 }