I have a code like this:
public function beforeValidationOnCreate()
but it doesn't work, it says that value is required
Yes, it works, you can see the unit-tests passing for that method here:
Does it still fail if you set $this->value to a valid value?