PhpBench\Tests\Unit\Benchmark\Metadata\Driver\AnnotationDriverTest::testLoadSubjectNonPrefixed PHP Метод

testLoadSubjectNonPrefixed() публичный Метод

It should return method metadata for non-prefixed methods with the Subject annotation.
    public function testLoadSubjectNonPrefixed()
    {
        $reflection = new ReflectionClass();
        $reflection->class = 'Test';
        $hierarchy = new ReflectionHierarchy();
        $hierarchy->addReflectionClass($reflection);
        $method = new ReflectionMethod();
        $method->reflectionClass = $reflection;
        $method->class = 'Test';
        $method->name = 'foo';
        $method->comment = <<<'EOT'
/**
 * @Subject()
 */
EOT;
        $reflection->methods[$method->name] = $method;
        $metadata = $this->createDriver()->getMetadataForHierarchy($hierarchy);
        $subjects = $metadata->getSubjects();
        $this->assertCount(1, $subjects);
    }