mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 18:13:13 +00:00
add more unit tests and normalize the "__toString" methods v2
This commit is contained in:
@@ -93,6 +93,52 @@ class ExampleTest extends TestCase
|
||||
$this->assertEquals(5, $tag->getLineCount());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::create
|
||||
* @covers ::__toString
|
||||
*/
|
||||
public function testStringRepresentationIsReturned() : void
|
||||
{
|
||||
$tag = Example::create('"example1.php" 10 5 test text');
|
||||
|
||||
$this->assertSame('"example1.php" 10 5 test text', (string) $tag);
|
||||
|
||||
// ---
|
||||
|
||||
$tag = Example::create('file://example1.php');
|
||||
|
||||
$this->assertSame('file://example1.php', (string) $tag);
|
||||
|
||||
// ---
|
||||
|
||||
$tag = Example::create('0 foo bar');
|
||||
|
||||
$this->assertSame('0 foo bar', (string) $tag);
|
||||
|
||||
// ---
|
||||
|
||||
$tag = Example::create('$redisCluster->pttl(\'key\');');
|
||||
|
||||
$this->assertSame('$redisCluster->pttl(\'key\');', (string) $tag);
|
||||
|
||||
// ---
|
||||
|
||||
$tag = Example::create(' "example1.php" 10 5 test text ');
|
||||
|
||||
$this->assertSame('"example1.php" 10 5 test text', (string) $tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::create
|
||||
* @covers ::__toString
|
||||
*/
|
||||
public function testStringRepresentationIsReturnedWithoutDescription() : void
|
||||
{
|
||||
$tag = Example::create('');
|
||||
|
||||
$this->assertSame('', (string) $tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user