public function testIfHasPropertyAnnotationFromUsedTrait() { // Check trait first $info = new ReflectionAnnotatedProperty(BaseTraitWithLabel::class, 'title'); $has = $info->hasAnnotation('Label'); $this->assertTrue($has); // Check inherited model model $model = new ModelWithInheritedLabelFromTrait(); $info = new ReflectionAnnotatedProperty($model, 'title'); $has = $info->hasAnnotation('Label'); $this->assertTrue($has); }
public function testIfHasPropertyAnnotationFromParentClassParent() { // Check base model first $model = new BaseModelWithLabel(); $info = new ReflectionAnnotatedProperty($model, 'title'); $has = $info->hasAnnotation('Label'); $this->assertTrue($has); // Check inherited model model $model = new ModelWithInheritedLabelDeep(); $info = new ReflectionAnnotatedProperty($model, 'title'); $has = $info->hasAnnotation('Label'); $this->assertTrue($has); }