You are here

public function TagTest::testTagHandlerCorrectRegistration in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php \phpDocumentor\Reflection\DocBlock\TagTest::testTagHandlerCorrectRegistration()

@covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler

Return value

void

File

vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php, line 77

Class

TagTest
Test class for \phpDocumentor\Reflection\DocBlock\Tag\VarTag

Namespace

phpDocumentor\Reflection\DocBlock

Code

public function testTagHandlerCorrectRegistration() {
  if (0 == ini_get('allow_url_include')) {
    $this
      ->markTestSkipped('"data" URIs for includes are required.');
  }
  $currentHandler = __NAMESPACE__ . '\\Tag\\VarTag';
  $tagPreReg = Tag::createInstance('@var mixed');
  $this
    ->assertInstanceOf($currentHandler, $tagPreReg);
  $this
    ->assertInstanceOf(__NAMESPACE__ . '\\Tag', $tagPreReg);
  include 'data:text/plain;base64,' . base64_encode(<<<TAG_HANDLER
<?php
    class MyTagHandler extends \\phpDocumentor\\Reflection\\DocBlock\\Tag {}
TAG_HANDLER
);
  $this
    ->assertTrue(Tag::registerTagHandler('var', '\\MyTagHandler'));
  $tagPostReg = Tag::createInstance('@var mixed');
  $this
    ->assertNotInstanceOf($currentHandler, $tagPostReg);
  $this
    ->assertInstanceOf(__NAMESPACE__ . '\\Tag', $tagPostReg);
  $this
    ->assertInstanceOf('\\MyTagHandler', $tagPostReg);
  $this
    ->assertTrue(Tag::registerTagHandler('var', $currentHandler));
}