BlockTest: fixed unintentional use of global BlockFactory

This commit is contained in:
Dylan K. Taylor 2022-06-24 23:41:13 +01:00
parent 61da920db0
commit 8e002fc1ca
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -114,8 +114,8 @@ class BlockTest extends TestCase{
$oldStateDataSize = $list["stateDataBits"];
self::assertSame($oldStateDataSize, Block::INTERNAL_STATE_DATA_BITS, "Changed number of state data bits - consistency check probably need regenerating");
$states = BlockFactory::getInstance()->getAllKnownStates();
foreach(BlockFactory::getInstance()->getAllKnownStates() as $stateId => $state){
$states = $this->blockFactory->getAllKnownStates();
foreach($states as $stateId => $state){
self::assertArrayHasKey($stateId, $knownStates, "New block state $stateId (" . $state->getTypeId() . ":" . $state->computeStateData() . ", " . print_r($state, true) . ") - consistency check may need regenerating");
self::assertSame($knownStates[$stateId], $state->getName());
}