Fixed build

This commit is contained in:
Dylan K. Taylor 2021-06-26 17:40:43 +01:00
parent 4a5bdefe8b
commit e43bca95bf
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,7 @@ namespace pocketmine\block;
use PHPUnit\Framework\TestCase;
use function file_get_contents;
use function is_array;
use function json_decode;
class BlockTest extends TestCase{
@ -145,6 +146,9 @@ class BlockTest extends TestCase{
public function testConsistency() : void{
$list = json_decode(file_get_contents(__DIR__ . '/block_factory_consistency_check.json'), true);
if(!is_array($list)){
throw new \pocketmine\utils\AssumptionFailedError("Old table should be array{knownStates: array<string, string>, remaps: array<string, int>}");
}
$knownStates = $list["knownStates"];
$remaps = $list["remaps"];

View File

@ -36,6 +36,9 @@ foreach($factory->getAllKnownStates() as $index => $block){
}
}
$oldTable = json_decode(file_get_contents(__DIR__ . '/block_factory_consistency_check.json'), true);
if(!is_array($oldTable)){
throw new \pocketmine\utils\AssumptionFailedError("Old table should be array{knownStates: array<string, string>, remaps: array<string, int>}");
}
$old = $oldTable["knownStates"];
$oldRemaps = $oldTable["remaps"];