mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +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)){
|
||||
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"];
|
||||
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}");
|
||||
}
|
||||
$old = [];
|
||||
/**
|
||||
* @var string $name
|
||||
* @var int[] $stateIds
|
||||
*/
|
||||
foreach($oldTable["knownStates"] as $name => $stateIds){
|
||||
foreach($stateIds as $stateId){
|
||||
$old[$stateId] = $name;
|
||||
|
Loading…
x
Reference in New Issue
Block a user