Generic types bug fix

This commit is contained in:
M@ster
2022-10-19 23:16:04 +02:00
parent 144140cd39
commit 295d2fba38
4 changed files with 87 additions and 16 deletions
@@ -1,7 +1,7 @@
<?php
/**
* phpDocumentor Return tag test.
*
*
* PHP version 5.3
*
* @author Mike van Riel <[email protected]>
@@ -96,6 +96,27 @@ class ReturnTagTest extends \PHPUnit_Framework_TestCase
'int',
array('int'),
"Number of Bobs"
),
array(
'return',
'array<int, string> Types of Bobs',
'array<int, string>',
array('array<int, string>'),
'Types of Bobs'
),
array(
'return',
'array<int, string>|string Types of Bobs',
'array<int, string>|string',
array('array<int, string>', 'string'),
'Types of Bobs'
),
array(
'return',
'array<int, string|bool>|string Types of Bobs',
'array<int, string|bool>|string',
array('array<int, string|bool>', 'string'),
'Types of Bobs'
)
);
}
@@ -1,7 +1,7 @@
<?php
/**
* phpDocumentor Collection Test
*
*
* PHP version 5.3
*
* @author Mike van Riel <[email protected]>
@@ -16,7 +16,7 @@ use Barryvdh\Reflection\DocBlock\Context;
/**
* Test class for \Barryvdh\Reflection\DocBlock\Type\Collection
*
*
* @covers Barryvdh\Reflection\DocBlock\Type\Collection
*
* @author Mike van Riel <[email protected]>
@@ -29,7 +29,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
/**
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::__construct
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::getContext
*
*
* @return void
*/
public function testConstruct()
@@ -42,7 +42,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
/**
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::__construct
*
*
* @return void
*/
public function testConstructWithTypes()
@@ -53,7 +53,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
/**
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::__construct
*
*
* @return void
*/
public function testConstructWithNamespace()
@@ -70,7 +70,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
/**
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::__construct
*
*
* @return void
*/
public function testConstructWithNamespaceAliases()
@@ -89,7 +89,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
*
* @dataProvider provideTypesToExpand
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::add
*
*
* @return void
*/
public function testAdd($fixture, $expected)
@@ -109,7 +109,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
*
* @dataProvider provideTypesToExpandWithoutNamespace
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::add
*
*
* @return void
*/
public function testAddWithoutNamespace($fixture, $expected)
@@ -146,7 +146,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
/**
* @covers Barryvdh\Reflection\DocBlock\Type\Collection::add
* @expectedException InvalidArgumentException
*
*
* @return void
*/
public function testAddWithInvalidArgument()
@@ -197,6 +197,22 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
'DocBlock[]|int[]',
array($namespace.'DocBlock[]', 'int[]')
),
array(
'array<int, string>',
array('array<int, string>')
),
array(
'array<int, string>|string',
array('array<int, string>', 'string')
),
array(
'array<int, float|bool>|string',
array('array<int, float|bool>', 'string')
),
array(
'array<int, string|array<int, bool>>|array<int, float>|string',
array('array<int, string|array<int, bool>>', 'array<int, float>', 'string')
),
array(
'LinkDescriptor::setLink()',
array($namespace.'LinkDescriptor::setLink()')