mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
tests/phpunit: populate iterable types for phpstan
This commit is contained in:
parent
54ccc330d5
commit
532dc0fb6f
@ -95,7 +95,8 @@ class BlockTest extends TestCase{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @return int[][]
|
||||
* @phpstan-return list<array{int,int}>
|
||||
*/
|
||||
public function blockGetProvider() : array{
|
||||
return [
|
||||
|
@ -61,6 +61,10 @@ class ItemTest extends TestCase{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed[][]
|
||||
* @phpstan-return list<array{string,int,int}>
|
||||
*/
|
||||
public function itemFromStringProvider() : array{
|
||||
return [
|
||||
["dye:4", ItemIds::DYE, 4],
|
||||
|
@ -69,6 +69,10 @@ class RegionLoaderTest extends TestCase{
|
||||
self::assertSame($data, $r->readChunk(0, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Generator|int[][]
|
||||
* @phpstan-return \Generator<int, array{int,int}, void, void>
|
||||
*/
|
||||
public function outOfBoundsCoordsProvider() : \Generator{
|
||||
yield [-1, -1];
|
||||
yield [32, 32];
|
||||
|
@ -33,6 +33,10 @@ class StupidJsonDecodeTest extends TestCase{
|
||||
$this->stupidJsonDecodeFunc = (new \ReflectionMethod(PlayerNetworkSessionAdapter::class, 'stupid_json_decode'))->getClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed[][]
|
||||
* @phpstan-return list<array{string,mixed}>
|
||||
*/
|
||||
public function stupidJsonDecodeProvider() : array{
|
||||
return [
|
||||
["[\n \"a\",\"b,c,d,e\\\" \",,0,1,2, false, 0.001]", ['a', 'b,c,d,e" ', '', 0, 1, 2, false, 0.001]],
|
||||
|
@ -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);
|
||||
|
@ -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 */"],
|
||||
|
Loading…
x
Reference in New Issue
Block a user