mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
PHPUnit migrated to attributes :(
This commit is contained in:
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\world\format\io\region;
|
||||
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use pocketmine\world\format\ChunkException;
|
||||
use Symfony\Component\Filesystem\Path;
|
||||
@ -82,11 +83,10 @@ class RegionLoaderTest extends TestCase{
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider outOfBoundsCoordsProvider
|
||||
*
|
||||
* @throws ChunkException
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
#[DataProvider("outOfBoundsCoordsProvider")]
|
||||
public function testWriteChunkOutOfBounds(int $x, int $z) : void{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->region->writeChunk($x, $z, str_repeat("\x00", 1000));
|
||||
@ -107,11 +107,10 @@ class RegionLoaderTest extends TestCase{
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider outOfBoundsCoordsProvider
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @throws \pocketmine\world\format\io\exception\CorruptedChunkException
|
||||
*/
|
||||
#[DataProvider("outOfBoundsCoordsProvider")]
|
||||
public function testReadChunkOutOfBounds(int $x, int $z) : void{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->region->readChunk($x, $z);
|
||||
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\world\format\io\region;
|
||||
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use function sprintf;
|
||||
|
||||
@ -40,9 +41,7 @@ class RegionLocationTableEntryTest extends TestCase{
|
||||
yield [new RegionLocationTableEntry(2, 4, 0), new RegionLocationTableEntry(3, 1, 0), true];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider overlapDataProvider
|
||||
*/
|
||||
#[DataProvider("overlapDataProvider")]
|
||||
public function testOverlap(RegionLocationTableEntry $entry1, RegionLocationTableEntry $entry2, bool $overlaps) : void{
|
||||
$stringify = function(RegionLocationTableEntry $entry) : string{
|
||||
return sprintf("entry first=%d last=%d size=%d", $entry->getFirstSector(), $entry->getLastSector(), $entry->getSectorCount());
|
||||
|
Reference in New Issue
Block a user