function DocParserTest::getConstantsProvider

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php \Drupal\Tests\Component\Annotation\Doctrine\DocParserTest::getConstantsProvider()
  2. 8.9.x core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php \Drupal\Tests\Component\Annotation\Doctrine\DocParserTest::getConstantsProvider()
  3. 10 core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php \Drupal\Tests\Component\Annotation\Doctrine\DocParserTest::getConstantsProvider()

File

core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php, line 763

Class

DocParserTest
This class is a near-copy of Doctrine\Tests\Common\Annotations\DocParserTest, which is part of the Doctrine project: <http://www.doctrine-project.org&gt;. It was copied from version 1.2.7.

Namespace

Drupal\Tests\Component\Annotation\Doctrine

Code

public static function getConstantsProvider() {
    $provider[] = array(
        '@AnnotationWithConstants(PHP_EOL)',
        PHP_EOL,
    );
    $provider[] = array(
        '@AnnotationWithConstants(\\SimpleXMLElement::class)',
        \SimpleXMLElement::class,
    );
    $provider[] = array(
        '@AnnotationWithConstants(AnnotationWithConstants::INTEGER)',
        AnnotationWithConstants::INTEGER,
    );
    $provider[] = array(
        '@Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationWithConstants(AnnotationWithConstants::STRING)',
        AnnotationWithConstants::STRING,
    );
    $provider[] = array(
        '@AnnotationWithConstants(Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationWithConstants::FLOAT)',
        AnnotationWithConstants::FLOAT,
    );
    $provider[] = array(
        '@AnnotationWithConstants(ClassWithConstants::SOME_VALUE)',
        ClassWithConstants::SOME_VALUE,
    );
    $provider[] = array(
        '@AnnotationWithConstants(ClassWithConstants::OTHER_KEY_)',
        ClassWithConstants::OTHER_KEY_,
    );
    $provider[] = array(
        '@AnnotationWithConstants(ClassWithConstants::OTHER_KEY_2)',
        ClassWithConstants::OTHER_KEY_2,
    );
    $provider[] = array(
        '@AnnotationWithConstants(Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\ClassWithConstants::SOME_VALUE)',
        ClassWithConstants::SOME_VALUE,
    );
    $provider[] = array(
        '@AnnotationWithConstants(IntefaceWithConstants::SOME_VALUE)',
        IntefaceWithConstants::SOME_VALUE,
    );
    $provider[] = array(
        '@AnnotationWithConstants(\\Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\IntefaceWithConstants::SOME_VALUE)',
        IntefaceWithConstants::SOME_VALUE,
    );
    $provider[] = array(
        '@AnnotationWithConstants({AnnotationWithConstants::STRING, AnnotationWithConstants::INTEGER, AnnotationWithConstants::FLOAT})',
        array(
            AnnotationWithConstants::STRING,
            AnnotationWithConstants::INTEGER,
            AnnotationWithConstants::FLOAT,
        ),
    );
    $provider[] = array(
        '@AnnotationWithConstants({
                AnnotationWithConstants::STRING = AnnotationWithConstants::INTEGER
             })',
        array(
            AnnotationWithConstants::STRING => AnnotationWithConstants::INTEGER,
        ),
    );
    $provider[] = array(
        '@AnnotationWithConstants({
                Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\IntefaceWithConstants::SOME_KEY = AnnotationWithConstants::INTEGER
             })',
        array(
            IntefaceWithConstants::SOME_KEY => AnnotationWithConstants::INTEGER,
        ),
    );
    $provider[] = array(
        '@AnnotationWithConstants({
                \\Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\IntefaceWithConstants::SOME_KEY = AnnotationWithConstants::INTEGER
             })',
        array(
            IntefaceWithConstants::SOME_KEY => AnnotationWithConstants::INTEGER,
        ),
    );
    $provider[] = array(
        '@AnnotationWithConstants({
                AnnotationWithConstants::STRING = AnnotationWithConstants::INTEGER,
                ClassWithConstants::SOME_KEY = ClassWithConstants::SOME_VALUE,
                Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\ClassWithConstants::SOME_KEY = IntefaceWithConstants::SOME_VALUE
             })',
        array(
            AnnotationWithConstants::STRING => AnnotationWithConstants::INTEGER,
            // Since this class is a near-copy of
            // Doctrine\Tests\Common\Annotations\DocParserTest, we don't fix
            // PHPStan errors here.
            // @phpstan-ignore array.duplicateKey
ClassWithConstants::SOME_KEY => ClassWithConstants::SOME_VALUE,
            ClassWithConstants::SOME_KEY => IntefaceWithConstants::SOME_VALUE,
        ),
    );
    $provider[] = array(
        '@AnnotationWithConstants(AnnotationWithConstants::class)',
        'Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationWithConstants',
    );
    $provider[] = array(
        '@AnnotationWithConstants({AnnotationWithConstants::class = AnnotationWithConstants::class})',
        array(
            'Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationWithConstants' => 'Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationWithConstants',
        ),
    );
    $provider[] = array(
        '@AnnotationWithConstants(Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationWithConstants::class)',
        'Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationWithConstants',
    );
    $provider[] = array(
        '@Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationWithConstants(Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationWithConstants::class)',
        'Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationWithConstants',
    );
    return $provider;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.