Skip to content

Commit b2e816c

Browse files
TomasVotrubajaapio
authored andcommitted
fix tests
1 parent 5e1bad3 commit b2e816c

File tree

3 files changed

+3
-55
lines changed

3 files changed

+3
-55
lines changed

src/DocBlock/TagFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function addService($service);
6767
*
6868
* @return Tag A new tag object.
6969
*/
70-
public function create(string $tagLine, TypeContext $context = null): Tag;
70+
public function create(string $tagLine, TypeContext $context = null): ?Tag;
7171

7272
/**
7373
* Registers a handler for tags.

tests/unit/DocBlockFactoryTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ public function testTagsWithContextNamespace()
263263

264264
$tagFactoryMock->shouldReceive('create')->with(m::any(), $context)->andReturn(new Param('param'));
265265
$docblock = $fixture->create('/** @param MyType $param */', $context);
266+
267+
$this->assertInstanceOf(DocBlock::class, $docblock);
266268
}
267269

268270
/**

tests/unit/DocBlockTest.php

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -48,36 +48,6 @@ public function testDocBlockCanHaveASummary()
4848
$this->assertSame($summary, $fixture->getSummary());
4949
}
5050

51-
/**
52-
* @covers ::__construct
53-
*
54-
* @expectedException \InvalidArgumentException
55-
*/
56-
public function testExceptionIsThrownIfSummaryIsNotAString()
57-
{
58-
new DocBlock([]);
59-
}
60-
61-
/**
62-
* @covers ::__construct
63-
*
64-
* @expectedException \InvalidArgumentException
65-
*/
66-
public function testExceptionIsThrownIfTemplateStartIsNotABoolean()
67-
{
68-
new DocBlock('', null, [], null, null, ['is not boolean']);
69-
}
70-
71-
/**
72-
* @covers ::__construct
73-
*
74-
* @expectedException \InvalidArgumentException
75-
*/
76-
public function testExceptionIsThrownIfTemplateEndIsNotABoolean()
77-
{
78-
new DocBlock('', null, [], null, null, false, ['is not boolean']);
79-
}
80-
8151
/**
8252
* @covers ::__construct
8353
* @covers ::getDescription
@@ -154,18 +124,6 @@ public function testFindTagsInDocBlockByName()
154124
$this->assertSame([], $fixture->getTagsByName('Ebcd'));
155125
}
156126

157-
/**
158-
* @covers ::__construct
159-
* @covers ::getTagsByName
160-
* @uses \phpDocumentor\Reflection\DocBlock\Description
161-
* @expectedException \InvalidArgumentException
162-
*/
163-
public function testExceptionIsThrownIfNameForTagsIsNotString()
164-
{
165-
$fixture = new DocBlock();
166-
$fixture->getTagsByName([]);
167-
}
168-
169127
/**
170128
* @covers ::__construct
171129
* @covers ::hasTag
@@ -191,18 +149,6 @@ public function testCheckIfThereAreTagsWithAGivenName()
191149
$this->assertFalse($fixture->hasTag('Ebcd'));
192150
}
193151

194-
/**
195-
* @covers ::__construct
196-
* @covers ::hasTag
197-
* @uses \phpDocumentor\Reflection\DocBlock\Description
198-
* @expectedException \InvalidArgumentException
199-
*/
200-
public function testExceptionIsThrownIfNameForCheckingTagsIsNotString()
201-
{
202-
$fixture = new DocBlock();
203-
$fixture->hasTag([]);
204-
}
205-
206152
/**
207153
* @covers ::__construct
208154
* @covers ::getContext

0 commit comments

Comments
 (0)