mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Merge branch 'stable'
This commit is contained in:
@ -28,7 +28,8 @@ use PHPUnit\Framework\TestCase;
|
||||
class ConfigTest extends TestCase{
|
||||
|
||||
/**
|
||||
* @return \Generator
|
||||
* @return \Generator|mixed[][]
|
||||
* @phpstan-return \Generator<int, array{string, mixed[]}, void, void>
|
||||
*/
|
||||
public function fixYamlIndexesProvider() : \Generator{
|
||||
yield ["x: 1\ny: 2\nz: 3\n", [
|
||||
@ -60,8 +61,8 @@ class ConfigTest extends TestCase{
|
||||
/**
|
||||
* @dataProvider fixYamlIndexesProvider
|
||||
*
|
||||
* @param string $test
|
||||
* @param array $expected
|
||||
* @param string $test
|
||||
* @param mixed[] $expected
|
||||
*/
|
||||
public function testFixYamlIndexes(string $test, array $expected) : void{
|
||||
$fixed = Config::fixYAMLIndexes($test);
|
||||
|
@ -29,7 +29,7 @@ use function defined;
|
||||
|
||||
class UtilsTest extends TestCase{
|
||||
|
||||
public function setUp(){
|
||||
public function setUp() : void{
|
||||
if(!defined('pocketmine\PATH')){
|
||||
define('pocketmine\PATH', 'dummy');
|
||||
}
|
||||
@ -38,6 +38,10 @@ class UtilsTest extends TestCase{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[][]
|
||||
* @phpstan-return list<array{string}>
|
||||
*/
|
||||
public function parseDocCommentNewlineProvider() : array{
|
||||
return [
|
||||
["\t/**\r\n\t * @param PlayerJoinEvent \$event\r\n\t * @priority HIGHEST\r\n\t * @notHandler\r\n\t */"],
|
||||
@ -61,6 +65,6 @@ class UtilsTest extends TestCase{
|
||||
|
||||
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(){}));
|
||||
self::assertSame('closure@' . Filesystem::cleanPath(__FILE__) . '#L' . __LINE__, Utils::getNiceClosureName(function() : void{}));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user