lithium\tests\cases\data\ModelTest::testValidationInheritance PHP Method

testValidationInheritance() public method

    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());
    }
ModelTest