4 * @covers MWDoxygenFilter
6 class MWDoxygenFilterTest
extends \PHPUnit\Framework\TestCase
{
8 public static function provideFilter() {
12 /** Some Words here */
18 yield
'One-line var with type' => [
28 protected SomeType $name;
33 yield
'One-line var with type and description' => [
36 /** @var SomeType Some description */
42 /** Some description */
43 protected SomeType $name;
48 yield
'One-line var with type and description that starts like a variable name' => [
51 /** @var array $_GET data from some thing */
57 /** $_GET data from some thing */
58 protected array $name;
63 yield
'One-line var with type, name, and description' => [
64 // In this full form, Doxygen understands it just fine.
68 /** @var SomeType $name Some description */
74 yield
'Multi-line var with type' => [
88 protected SomeType $name;
93 yield
'Multi-line var with type and description' => [
104 <?php class MyClass {
109 protected SomeType $name;
114 yield
'Multi-line var with type, name, and description' => [
116 <?php class MyClass {
119 * @var SomeType $name
125 <?php class MyClass {
128 * @var SomeType $name
137 * @dataProvider provideFilter
139 public function testFilter( $source, $expected = null ) {
140 if ( $expected === null ) {
143 $this->assertSame( $expected, MWDoxygenFilter
::filter( $source ), 'Source code' );