Пример #1
0
<?php

namespace Headzoo\Reflection\Tests;

use Headzoo\Reflection\AnnotatedReflection;
use Headzoo\Reflection\Annotation\Headzoo;
use Headzoo\Reflection\Annotation\Headzoo\Integer;
use Headzoo\Reflection\Annotation\Headzoo\Method;
use Headzoo\Reflection\Annotation\Headzoo\Property;
use Headzoo\Reflection\Annotation\Headzoo\TestClass;
use Headzoo\Reflection\Annotation\Headzoo\TestPerson;
AnnotatedReflection::registerAnnotations([Integer::class, Method::class, Property::class, TestPerson::class, TestClass::class]);
/**
 * @Headzoo\TestPerson("headzoo", job="code_monkey")
 */
class ParentPerson
{
    /**
     * @Headzoo\Property
     * @Headzoo\Integer
     */
    public $id;
    /**
     * @Headzoo\Integer
     * @Headzoo\Method
     */
    public function getId()
    {
    }
}
/**
 /**
  * @covers ::registerAnnotation
  * @covers ::registerAnnotations
  */
 public function testRegisterAnnotation()
 {
     $this->assertTrue(AnnotatedReflection::registerAnnotation(Property::class));
     $this->assertTrue(AnnotatedReflection::registerAnnotations([TestClass::class, TestPerson::class, Property::class]));
     $this->assertEquals([Property::class, TestClass::class, TestPerson::class], AnnotatedReflection::getRegisteredAnnotations());
 }