function DocParserTest::getAnnotationVarTypeArrayProviderInvalid

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php \Drupal\Tests\Component\Annotation\Doctrine\DocParserTest::getAnnotationVarTypeArrayProviderInvalid()
  2. 8.9.x core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php \Drupal\Tests\Component\Annotation\Doctrine\DocParserTest::getAnnotationVarTypeArrayProviderInvalid()
  3. 10 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 507

Class

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

Namespace

Drupal\Tests\Component\Annotation\Doctrine

Code

public static 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',
        ),
    );
}

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