Skip to content

Commit

Permalink
Make tests conditional
Browse files Browse the repository at this point in the history
Since phpDocumentor introduced BC breaking changes in V5 tests need to
be conditional, depending on the used version (DEPS=low)
  • Loading branch information
DerManoMann committed Jun 12, 2020
1 parent 46dd11f commit a9eb0d7
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -48,11 +48,13 @@ public function testParamTagTypeIsOmitted()

public function invalidTypesProvider()
{
$phpDocumentorV5 = class_exists('\phpDocumentor\Reflection\DocBlock\Tags\InvalidTag');

return [
'pub' => ['pub', null, null],
'stat' => ['stat', null, null],
'foo' => ['foo', 'Foo.', null],
'bar' => ['bar', 'Bar.', null],
'foo' => ['foo', $phpDocumentorV5 ? 'Foo.' : null, null],
'bar' => ['bar', $phpDocumentorV5 ? 'Bar.' : null, null],
];
}

Expand All @@ -78,6 +80,8 @@ public function testExtractTypesWithNoPrefixes($property, array $type = null)

public function typesProvider()
{
$phpDocumentorV5 = class_exists('\phpDocumentor\Reflection\DocBlock\Tags\InvalidTag');

return [
['foo', null, 'Short description.', 'Long description.'],
['bar', [new Type(Type::BUILTIN_TYPE_STRING)], 'This is bar', null],
Expand Down Expand Up @@ -114,7 +118,7 @@ public function typesProvider()
['donotexist', null, null, null],
['staticGetter', null, null, null],
['staticSetter', null, null, null],
['emptyVar', null, 'This should not be removed.', null],
['emptyVar', null, $phpDocumentorV5 ? 'This should not be removed.' : null, null],
];
}

Expand Down

0 comments on commit a9eb0d7

Please sign in to comment.