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, name, and description' => [
49 // In this full form, Doxygen understands it just fine.
53 /** @var SomeType $name Some description */
59 yield
'Multi-line var with type' => [
73 protected SomeType $name;
78 yield
'Multi-line var with type and description' => [
94 protected SomeType $name;
99 yield
'Multi-line var with type, name, and description' => [
101 <?php class MyClass {
104 * @var SomeType $name
110 <?php class MyClass {
113 * @var SomeType $name
122 * @dataProvider provideFilter
124 public function testFilter( $source, $expected = null ) {
125 if ( $expected === null ) {
128 $this->assertSame( $expected, MWDoxygenFilter
::filter( $source ), 'Source code' );