示例#1
0
 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);
 }
示例#2
0
 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);
 }