function DocParserTest::testReservedKeywordsInAnnotations

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php \Drupal\Tests\Component\Annotation\Doctrine\DocParserTest::testReservedKeywordsInAnnotations()

File

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

Class

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

Namespace

Drupal\Tests\Component\Annotation\Doctrine

Code

public function testReservedKeywordsInAnnotations() {
    if (PHP_VERSION_ID >= 70000) {
        $this->markTestSkipped('This test requires PHP 5.6 or lower.');
    }
    require 'ReservedKeywordsClasses.php';
    $parser = $this->createTestParser();
    $result = $parser->parse('@Drupal\\Tests\\Component\\Annotation\\Doctrine\\True');
    $this->assertInstanceOf(True::class, $result[0]);
    $result = $parser->parse('@Drupal\\Tests\\Component\\Annotation\\Doctrine\\False');
    $this->assertInstanceOf(False::class, $result[0]);
    $result = $parser->parse('@Drupal\\Tests\\Component\\Annotation\\Doctrine\\Null');
    $this->assertInstanceOf(Null::class, $result[0]);
    $result = $parser->parse('@True');
    $this->assertInstanceOf(True::class, $result[0]);
    $result = $parser->parse('@False');
    $this->assertInstanceOf(False::class, $result[0]);
    $result = $parser->parse('@Null');
    $this->assertInstanceOf(Null::class, $result[0]);
}

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