Esempio n. 1
0
 /**
  * @covers ::initialize
  */
 public function testInitialize()
 {
     $product = new Product(['currency' => null]);
     $product->validate();
     $this->assertEquals('currency must be present', $product->getErrors()->humanize());
     $product->currency = '123';
     $product->validate();
     $this->assertEquals('currency is invalid', $product->getErrors()->humanize());
 }
Esempio n. 2
0
 /**
  * @covers ::initialize
  */
 public function testInitialize()
 {
     $product = new Product(['value' => null]);
     $product->validate();
     $this->assertEquals('value must be present', $product->getErrors()->humanize());
     $product->value = 'asd';
     $product->validate();
     $this->assertEquals('value is an invalid number', $product->getErrors()->humanize());
 }