mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
"Link" -> add some more tests
This commit is contained in:
@@ -16,6 +16,9 @@ namespace phpDocumentor\Reflection\DocBlock\Tags;
|
|||||||
use Mockery as m;
|
use Mockery as m;
|
||||||
use phpDocumentor\Reflection\DocBlock\Description;
|
use phpDocumentor\Reflection\DocBlock\Description;
|
||||||
use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
|
use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
|
||||||
|
use phpDocumentor\Reflection\DocBlock\StandardTagFactory;
|
||||||
|
use phpDocumentor\Reflection\Fqsen;
|
||||||
|
use phpDocumentor\Reflection\FqsenResolver;
|
||||||
use phpDocumentor\Reflection\Types\Context;
|
use phpDocumentor\Reflection\Types\Context;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
@@ -163,6 +166,60 @@ class LinkTest extends TestCase
|
|||||||
$this->assertSame($description, $fixture->getDescription());
|
$this->assertSame($description, $fixture->getDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\See::<public>
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
|
||||||
|
* @uses \phpDocumentor\Reflection\FqsenResolver
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Description
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Url
|
||||||
|
* @uses \phpDocumentor\Reflection\Types\Context
|
||||||
|
*
|
||||||
|
* @covers ::create
|
||||||
|
*/
|
||||||
|
public function testFactoryMethodWithoutSpaceBeforeUrl() : void
|
||||||
|
{
|
||||||
|
$fqsenResolver = new FqsenResolver();
|
||||||
|
$tagFactory = new StandardTagFactory($fqsenResolver);
|
||||||
|
$descriptionFactory = new DescriptionFactory($tagFactory);
|
||||||
|
$context = new Context('');
|
||||||
|
|
||||||
|
$fixture = Link::create(
|
||||||
|
'http://this.is.my/link My Description ',
|
||||||
|
$descriptionFactory,
|
||||||
|
$context
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertSame('http://this.is.my/link My Description ', (string) $fixture);
|
||||||
|
$this->assertSame('My Description ', $fixture->getDescription() . '');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\See::<public>
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
|
||||||
|
* @uses \phpDocumentor\Reflection\FqsenResolver
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Description
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Url
|
||||||
|
* @uses \phpDocumentor\Reflection\Types\Context
|
||||||
|
*
|
||||||
|
* @covers ::create
|
||||||
|
*/
|
||||||
|
public function testFactoryMethodWithSpaceBeforeUrl() : void
|
||||||
|
{
|
||||||
|
$fqsenResolver = new FqsenResolver();
|
||||||
|
$tagFactory = new StandardTagFactory($fqsenResolver);
|
||||||
|
$descriptionFactory = new DescriptionFactory($tagFactory);
|
||||||
|
$context = new Context('');
|
||||||
|
|
||||||
|
$fixture = Link::create(
|
||||||
|
' http://this.is.my/link My Description ',
|
||||||
|
$descriptionFactory,
|
||||||
|
$context
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertSame('http://this.is.my/link My Description ', (string) $fixture);
|
||||||
|
$this->assertSame('http://this.is.my/link My Description ', $fixture->getDescription() . '');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Link::<public>
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Link::<public>
|
||||||
* @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
|
* @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
|
||||||
|
|||||||
Reference in New Issue
Block a user