Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4095787
MWDoxygenFilterTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
MWDoxygenFilterTest.php
View Options
<?php
use
MediaWiki\Maintenance\MWDoxygenFilter
;
/**
* @covers \MediaWiki\Maintenance\MWDoxygenFilter
*/
class
MWDoxygenFilterTest
extends
\PHPUnit\Framework\TestCase
{
use
MediaWikiCoversValidator
;
public
static
function
provideFilter
()
{
yield
'No @var'
=>
[
<<<'CODE'
<?php class MyClass {
/** Some Words here */
protected $name;
}
CODE
];
yield
'One-line var with type'
=>
[
<<<'CODE'
<?php class MyClass {
/** @var SomeType */
protected $name;
}
CODE
,
<<<'CODE'
<?php class MyClass {
/** */
protected SomeType $name;
}
CODE
];
yield
'One-line var with type and description'
=>
[
<<<'CODE'
<?php class MyClass {
/** @var SomeType Some description */
protected $name;
}
CODE
,
<<<'CODE'
<?php class MyClass {
/** Some description */
protected SomeType $name;
}
CODE
];
yield
'One-line var with type and description that starts like a variable name'
=>
[
<<<'CODE'
<?php class MyClass {
/** @var array $_GET data from some thing */
protected $name;
}
CODE
,
<<<'CODE'
<?php class MyClass {
/** $_GET data from some thing */
protected array $name;
}
CODE
];
yield
'One-line var with type, name, and description'
=>
[
// In this full form, Doxygen understands it just fine.
// No changes made.
<<<'CODE'
<?php class MyClass {
/** @var SomeType $name Some description */
protected $name;
}
CODE
];
yield
'Multi-line var with type'
=>
[
<<<'CODE'
<?php class MyClass {
/**
* @var SomeType
*/
protected $name;
}
CODE
,
<<<'CODE'
<?php class MyClass {
/**
*
*/
protected SomeType $name;
}
CODE
];
yield
'Multi-line var with type and description'
=>
[
<<<'CODE'
<?php class MyClass {
/**
* Some description
* @var SomeType
*/
protected $name;
}
CODE
,
<<<'CODE'
<?php class MyClass {
/**
* Some description
*
*/
protected SomeType $name;
}
CODE
];
yield
'Multi-line var with type, name, and description'
=>
[
<<<'CODE'
<?php class MyClass {
/**
* Some description
* @var SomeType $name
*/
protected $name;
}
CODE
,
<<<'CODE'
<?php class MyClass {
/**
* Some description
* @var SomeType $name
*/
protected $name;
}
CODE
];
}
/**
* @dataProvider provideFilter
*/
public
function
testFilter
(
$source
,
$expected
=
null
)
{
$this
->
assertSame
(
$expected
??
$source
,
MWDoxygenFilter
::
filter
(
$source
),
'Source code'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 14:03 (4 w, 3 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
7f/b5/fa669a2e1113a775127561d082bc
Default Alt Text
MWDoxygenFilterTest.php (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment