public function DocParserTest::getAnnotationVarTypeProviderInvalid

File

drupal/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php, line 417

Class

DocParserTest

Namespace

Doctrine\Tests\Common\Annotations

Code

public function getAnnotationVarTypeProviderInvalid() {

  //({attribute name}, {type declared type}, {attribute value} , {given type or class})
  return array(
    // boolean type
    array(
      'boolean',
      'boolean',
      '1',
      'integer',
    ),
    array(
      'boolean',
      'boolean',
      '1.2',
      'double',
    ),
    array(
      'boolean',
      'boolean',
      '"str"',
      'string',
    ),
    array(
      'boolean',
      'boolean',
      '{1,2,3}',
      'array',
    ),
    array(
      'boolean',
      'boolean',
      '@Name',
      'an instance of Doctrine\\Tests\\Common\\Annotations\\Name',
    ),
    // alias for internal type boolean
    array(
      'bool',
      'bool',
      '1',
      'integer',
    ),
    array(
      'bool',
      'bool',
      '1.2',
      'double',
    ),
    array(
      'bool',
      'bool',
      '"str"',
      'string',
    ),
    array(
      'bool',
      'bool',
      '{"str"}',
      'array',
    ),
    // integer type
    array(
      'integer',
      'integer',
      'true',
      'boolean',
    ),
    array(
      'integer',
      'integer',
      'false',
      'boolean',
    ),
    array(
      'integer',
      'integer',
      '1.2',
      'double',
    ),
    array(
      'integer',
      'integer',
      '"str"',
      'string',
    ),
    array(
      'integer',
      'integer',
      '{"str"}',
      'array',
    ),
    array(
      'integer',
      'integer',
      '{1,2,3,4}',
      'array',
    ),
    // alias for internal type double
    array(
      'float',
      'float',
      'true',
      'boolean',
    ),
    array(
      'float',
      'float',
      'false',
      'boolean',
    ),
    array(
      'float',
      'float',
      '123',
      'integer',
    ),
    array(
      'float',
      'float',
      '"str"',
      'string',
    ),
    array(
      'float',
      'float',
      '{"str"}',
      'array',
    ),
    array(
      'float',
      'float',
      '{12.34}',
      'array',
    ),
    array(
      'float',
      'float',
      '{1,2,3}',
      'array',
    ),
    // string type
    array(
      'string',
      'string',
      'true',
      'boolean',
    ),
    array(
      'string',
      'string',
      'false',
      'boolean',
    ),
    array(
      'string',
      'string',
      '12',
      'integer',
    ),
    array(
      'string',
      'string',
      '1.2',
      'double',
    ),
    array(
      'string',
      'string',
      '{"str"}',
      'array',
    ),
    array(
      'string',
      'string',
      '{1,2,3,4}',
      'array',
    ),
    // annotation instance
    array(
      'annotation',
      'Doctrine\\Tests\\Common\\Annotations\\Fixtures\\AnnotationTargetAll',
      'true',
      'boolean',
    ),
    array(
      'annotation',
      'Doctrine\\Tests\\Common\\Annotations\\Fixtures\\AnnotationTargetAll',
      'false',
      'boolean',
    ),
    array(
      'annotation',
      'Doctrine\\Tests\\Common\\Annotations\\Fixtures\\AnnotationTargetAll',
      '12',
      'integer',
    ),
    array(
      'annotation',
      'Doctrine\\Tests\\Common\\Annotations\\Fixtures\\AnnotationTargetAll',
      '1.2',
      'double',
    ),
    array(
      'annotation',
      'Doctrine\\Tests\\Common\\Annotations\\Fixtures\\AnnotationTargetAll',
      '{"str"}',
      'array',
    ),
    array(
      'annotation',
      'Doctrine\\Tests\\Common\\Annotations\\Fixtures\\AnnotationTargetAll',
      '{1,2,3,4}',
      'array',
    ),
    array(
      'annotation',
      'Doctrine\\Tests\\Common\\Annotations\\Fixtures\\AnnotationTargetAll',
      '@Name',
      'an instance of Doctrine\\Tests\\Common\\Annotations\\Name',
    ),
  );
}