mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 18:13:13 +00:00
fix tests
This commit is contained in:
committed by
Jaap van Otterdijk
parent
5e1bad3628
commit
b2e816c8ad
@@ -67,7 +67,7 @@ interface TagFactory
|
|||||||
*
|
*
|
||||||
* @return Tag A new tag object.
|
* @return Tag A new tag object.
|
||||||
*/
|
*/
|
||||||
public function create(string $tagLine, TypeContext $context = null): Tag;
|
public function create(string $tagLine, TypeContext $context = null): ?Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers a handler for tags.
|
* Registers a handler for tags.
|
||||||
|
|||||||
@@ -263,6 +263,8 @@ DOCBLOCK
|
|||||||
|
|
||||||
$tagFactoryMock->shouldReceive('create')->with(m::any(), $context)->andReturn(new Param('param'));
|
$tagFactoryMock->shouldReceive('create')->with(m::any(), $context)->andReturn(new Param('param'));
|
||||||
$docblock = $fixture->create('/** @param MyType $param */', $context);
|
$docblock = $fixture->create('/** @param MyType $param */', $context);
|
||||||
|
|
||||||
|
$this->assertInstanceOf(DocBlock::class, $docblock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -48,36 +48,6 @@ class DocBlockTest extends TestCase
|
|||||||
$this->assertSame($summary, $fixture->getSummary());
|
$this->assertSame($summary, $fixture->getSummary());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers ::__construct
|
|
||||||
*
|
|
||||||
* @expectedException \InvalidArgumentException
|
|
||||||
*/
|
|
||||||
public function testExceptionIsThrownIfSummaryIsNotAString()
|
|
||||||
{
|
|
||||||
new DocBlock([]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers ::__construct
|
|
||||||
*
|
|
||||||
* @expectedException \InvalidArgumentException
|
|
||||||
*/
|
|
||||||
public function testExceptionIsThrownIfTemplateStartIsNotABoolean()
|
|
||||||
{
|
|
||||||
new DocBlock('', null, [], null, null, ['is not boolean']);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers ::__construct
|
|
||||||
*
|
|
||||||
* @expectedException \InvalidArgumentException
|
|
||||||
*/
|
|
||||||
public function testExceptionIsThrownIfTemplateEndIsNotABoolean()
|
|
||||||
{
|
|
||||||
new DocBlock('', null, [], null, null, false, ['is not boolean']);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers ::__construct
|
* @covers ::__construct
|
||||||
* @covers ::getDescription
|
* @covers ::getDescription
|
||||||
@@ -154,18 +124,6 @@ class DocBlockTest extends TestCase
|
|||||||
$this->assertSame([], $fixture->getTagsByName('Ebcd'));
|
$this->assertSame([], $fixture->getTagsByName('Ebcd'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers ::__construct
|
|
||||||
* @covers ::getTagsByName
|
|
||||||
* @uses \phpDocumentor\Reflection\DocBlock\Description
|
|
||||||
* @expectedException \InvalidArgumentException
|
|
||||||
*/
|
|
||||||
public function testExceptionIsThrownIfNameForTagsIsNotString()
|
|
||||||
{
|
|
||||||
$fixture = new DocBlock();
|
|
||||||
$fixture->getTagsByName([]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers ::__construct
|
* @covers ::__construct
|
||||||
* @covers ::hasTag
|
* @covers ::hasTag
|
||||||
@@ -191,18 +149,6 @@ class DocBlockTest extends TestCase
|
|||||||
$this->assertFalse($fixture->hasTag('Ebcd'));
|
$this->assertFalse($fixture->hasTag('Ebcd'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers ::__construct
|
|
||||||
* @covers ::hasTag
|
|
||||||
* @uses \phpDocumentor\Reflection\DocBlock\Description
|
|
||||||
* @expectedException \InvalidArgumentException
|
|
||||||
*/
|
|
||||||
public function testExceptionIsThrownIfNameForCheckingTagsIsNotString()
|
|
||||||
{
|
|
||||||
$fixture = new DocBlock();
|
|
||||||
$fixture->hasTag([]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers ::__construct
|
* @covers ::__construct
|
||||||
* @covers ::getContext
|
* @covers ::getContext
|
||||||
|
|||||||
Reference in New Issue
Block a user