BlockFactory: enforce stricter checks

this can help catch out variant-related bugs.
This commit is contained in:
Dylan K. Taylor 2019-02-24 17:59:09 +00:00
parent b7b05e729e
commit 6cb263fcca

View File

@ -146,9 +146,11 @@ class BlockTest extends TestCase{
$states = BlockFactory::getAllKnownStates();
foreach($states as $k => $state){
self::assertArrayHasKey($k, $list, "New block state $k (" . $state->getName() . ") - consistency check may need regenerating");
self::assertSame($list[$k], $state->getName());
}
foreach($list as $k => $name){
self::assertArrayHasKey($k, $states, "Missing previously-known block state $k ($name)");
self::assertSame($name, $states[$k]->getName());
}
}
}