mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 00:25:04 +00:00
Merge branch 'next-minor'
This commit is contained in:
@ -63,6 +63,32 @@ class UtilsTest extends TestCase{
|
||||
self::assertEquals("HIGHEST", $tags["priority"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[][]
|
||||
* @phpstan-return list<array{string}>
|
||||
*/
|
||||
public function parseDocCommentOneLineProvider() : array{
|
||||
return [
|
||||
["/** @ignoreCancelled true dummy */"],
|
||||
["/**@ignoreCancelled true dummy*/"],
|
||||
["/** @ignoreCancelled true dummy */"]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider parseDocCommentOneLineProvider
|
||||
*/
|
||||
public function testParseOneLineDocComment(string $comment) : void{
|
||||
$tags = Utils::parseDocComment($comment);
|
||||
self::assertArrayHasKey("ignoreCancelled", $tags);
|
||||
self::assertEquals("true dummy", $tags["ignoreCancelled"]);
|
||||
}
|
||||
|
||||
public function testParseEmptyDocComment() : void{
|
||||
$tags = Utils::parseDocComment("");
|
||||
self::assertCount(0, $tags);
|
||||
}
|
||||
|
||||
public function testNamespacedNiceClosureName() : void{
|
||||
//be careful with this test. The closure has to be declared on the same line as the assertion.
|
||||
self::assertSame('closure@' . Filesystem::cleanPath(__FILE__) . '#L' . __LINE__, Utils::getNiceClosureName(function() : void{}));
|
||||
|
Reference in New Issue
Block a user