function DocParserTest::getAnnotationVarTypeProviderValid

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

File

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

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 getAnnotationVarTypeProviderValid() {
  //({attribute name}, {attribute value})
  return array(
    // mixed type
array(
      'mixed',
      '"String Value"',
    ),
    array(
      'mixed',
      'true',
    ),
    array(
      'mixed',
      'false',
    ),
    array(
      'mixed',
      '1',
    ),
    array(
      'mixed',
      '1.2',
    ),
    array(
      'mixed',
      '@Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationTargetAll',
    ),
    // boolean type
array(
      'boolean',
      'true',
    ),
    array(
      'boolean',
      'false',
    ),
    // alias for internal type boolean
array(
      'bool',
      'true',
    ),
    array(
      'bool',
      'false',
    ),
    // integer type
array(
      'integer',
      '0',
    ),
    array(
      'integer',
      '1',
    ),
    array(
      'integer',
      '123456789',
    ),
    array(
      'integer',
      '9223372036854775807',
    ),
    // alias for internal type double
array(
      'float',
      '0.1',
    ),
    array(
      'float',
      '1.2',
    ),
    array(
      'float',
      '123.456',
    ),
    // string type
array(
      'string',
      '"String Value"',
    ),
    array(
      'string',
      '"true"',
    ),
    array(
      'string',
      '"123"',
    ),
    // array type
array(
      'array',
      '{@AnnotationExtendsAnnotationTargetAll}',
    ),
    array(
      'array',
      '{@AnnotationExtendsAnnotationTargetAll,@AnnotationExtendsAnnotationTargetAll}',
    ),
    array(
      'arrayOfIntegers',
      '1',
    ),
    array(
      'arrayOfIntegers',
      '{1}',
    ),
    array(
      'arrayOfIntegers',
      '{1,2,3,4}',
    ),
    array(
      'arrayOfAnnotations',
      '@AnnotationExtendsAnnotationTargetAll',
    ),
    array(
      'arrayOfAnnotations',
      '{@Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationTargetAll}',
    ),
    array(
      'arrayOfAnnotations',
      '{@AnnotationExtendsAnnotationTargetAll, @Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationTargetAll}',
    ),
    // annotation instance
array(
      'annotation',
      '@Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationTargetAll',
    ),
    array(
      'annotation',
      '@AnnotationExtendsAnnotationTargetAll',
    ),
  );
}

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