Inheritance: extends lithium\data\Model
Beispiel #1
0
 public function testValidationInheritance()
 {
     $product = MockProduct::create();
     $antique = MockSubProduct::create();
     $errors = array('name' => array('Name cannot be empty.'), 'price' => array('Price cannot be empty.', 'Price must have a numeric value.'));
     $this->assertFalse($product->validates());
     $this->assertEqual($errors, $product->errors());
     $errors += array('refurb' => array('Must have a boolean value.'));
     $this->assertFalse($antique->validates());
     $this->assertEqual($errors, $antique->errors());
 }