mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 08:39:53 +00:00
Fixed botched unit tests
This commit is contained in:
parent
8886a023f1
commit
b0c76f4db5
@ -110,7 +110,16 @@ class BlockTest extends TestCase{
|
|||||||
if(!is_array($list)){
|
if(!is_array($list)){
|
||||||
throw new \pocketmine\utils\AssumptionFailedError("Old table should be array{knownStates: array<string, string>, stateDataBits: int}");
|
throw new \pocketmine\utils\AssumptionFailedError("Old table should be array{knownStates: array<string, string>, stateDataBits: int}");
|
||||||
}
|
}
|
||||||
$knownStates = $list["knownStates"];
|
$knownStates = [];
|
||||||
|
/**
|
||||||
|
* @var string $name
|
||||||
|
* @var int[] $stateIds
|
||||||
|
*/
|
||||||
|
foreach($list["knownStates"] as $name => $stateIds){
|
||||||
|
foreach($stateIds as $stateId){
|
||||||
|
$knownStates[$stateId] = $name;
|
||||||
|
}
|
||||||
|
}
|
||||||
$oldStateDataSize = $list["stateDataBits"];
|
$oldStateDataSize = $list["stateDataBits"];
|
||||||
self::assertSame($oldStateDataSize, Block::INTERNAL_STATE_DATA_BITS, "Changed number of state data bits - consistency check probably need regenerating");
|
self::assertSame($oldStateDataSize, Block::INTERNAL_STATE_DATA_BITS, "Changed number of state data bits - consistency check probably need regenerating");
|
||||||
|
|
||||||
|
@ -46,6 +46,10 @@ if(file_exists($oldTablePath)){
|
|||||||
throw new \pocketmine\utils\AssumptionFailedError("Old table should be array{knownStates: array<string, string>, stateDataBits: int}");
|
throw new \pocketmine\utils\AssumptionFailedError("Old table should be array{knownStates: array<string, string>, stateDataBits: int}");
|
||||||
}
|
}
|
||||||
$old = [];
|
$old = [];
|
||||||
|
/**
|
||||||
|
* @var string $name
|
||||||
|
* @var int[] $stateIds
|
||||||
|
*/
|
||||||
foreach($oldTable["knownStates"] as $name => $stateIds){
|
foreach($oldTable["knownStates"] as $name => $stateIds){
|
||||||
foreach($stateIds as $stateId){
|
foreach($stateIds as $stateId){
|
||||||
$old[$stateId] = $name;
|
$old[$stateId] = $name;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user