You are here

public function DocParserTest::getAnnotationVarTypeArrayProviderInvalid in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php \Drupal\Tests\Component\Annotation\Doctrine\DocParserTest::getAnnotationVarTypeArrayProviderInvalid()

File

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

Class

DocParserTest
@coversDefaultClass \Drupal\Component\Annotation\Doctrine\DocParser

Namespace

Drupal\Tests\Component\Annotation\Doctrine

Code

public function getAnnotationVarTypeArrayProviderInvalid() {

  //({attribute name}, {type declared type}, {attribute value} , {given type or class})
  return array(
    array(
      'arrayOfIntegers',
      'integer',
      'true',
      'boolean',
    ),
    array(
      'arrayOfIntegers',
      'integer',
      'false',
      'boolean',
    ),
    array(
      'arrayOfIntegers',
      'integer',
      '{true,true}',
      'boolean',
    ),
    array(
      'arrayOfIntegers',
      'integer',
      '{1,true}',
      'boolean',
    ),
    array(
      'arrayOfIntegers',
      'integer',
      '{1,2,1.2}',
      'double',
    ),
    array(
      'arrayOfIntegers',
      'integer',
      '{1,2,"str"}',
      'string',
    ),
    array(
      'arrayOfStrings',
      'string',
      'true',
      'boolean',
    ),
    array(
      'arrayOfStrings',
      'string',
      'false',
      'boolean',
    ),
    array(
      'arrayOfStrings',
      'string',
      '{true,true}',
      'boolean',
    ),
    array(
      'arrayOfStrings',
      'string',
      '{"foo",true}',
      'boolean',
    ),
    array(
      'arrayOfStrings',
      'string',
      '{"foo","bar",1.2}',
      'double',
    ),
    array(
      'arrayOfStrings',
      'string',
      '1',
      'integer',
    ),
    array(
      'arrayOfAnnotations',
      'Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationTargetAll',
      'true',
      'boolean',
    ),
    array(
      'arrayOfAnnotations',
      'Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationTargetAll',
      'false',
      'boolean',
    ),
    array(
      'arrayOfAnnotations',
      'Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationTargetAll',
      '{@Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationTargetAll,true}',
      'boolean',
    ),
    array(
      'arrayOfAnnotations',
      'Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationTargetAll',
      '{@Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationTargetAll,true}',
      'boolean',
    ),
    array(
      'arrayOfAnnotations',
      'Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationTargetAll',
      '{@Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationTargetAll,1.2}',
      'double',
    ),
    array(
      'arrayOfAnnotations',
      'Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationTargetAll',
      '{@Drupal\\Tests\\Component\\Annotation\\Doctrine\\Fixtures\\AnnotationTargetAll,@AnnotationExtendsAnnotationTargetAll,"str"}',
      'string',
    ),
  );
}