mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 03:51:37 +00:00
Broaden scope of testing for item serializer/deserializer
this change will cause failing tests; it has found a problem with coral fans of which I was previously unaware
This commit is contained in:
@@ -24,8 +24,8 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\data\bedrock\item;
|
namespace pocketmine\data\bedrock\item;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use pocketmine\block\VanillaBlocks;
|
use pocketmine\block\BlockFactory;
|
||||||
use pocketmine\item\VanillaItems;
|
use pocketmine\item\ItemFactory;
|
||||||
|
|
||||||
final class ItemSerializerDeserializerTest extends TestCase{
|
final class ItemSerializerDeserializerTest extends TestCase{
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ final class ItemSerializerDeserializerTest extends TestCase{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testAllVanillaItemsSerializableAndDeserializable() : void{
|
public function testAllVanillaItemsSerializableAndDeserializable() : void{
|
||||||
foreach(VanillaItems::getAll() as $item){
|
foreach(ItemFactory::getInstance()->getAllRegistered() as $item){
|
||||||
if($item->isNull()){
|
if($item->isNull()){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ final class ItemSerializerDeserializerTest extends TestCase{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testAllVanillaBlocksSerializableAndDeserializable() : void{
|
public function testAllVanillaBlocksSerializableAndDeserializable() : void{
|
||||||
foreach(VanillaBlocks::getAll() as $block){
|
foreach(BlockFactory::getInstance()->getAllKnownStates() as $block){
|
||||||
$item = $block->asItem();
|
$item = $block->asItem();
|
||||||
if($item->isNull()){
|
if($item->isNull()){
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user