diff --git a/tests/phpunit/network/mcpe/protocol/DataPacketTest.php b/tests/phpunit/network/mcpe/protocol/DataPacketTest.php deleted file mode 100644 index 880be1e8f..000000000 --- a/tests/phpunit/network/mcpe/protocol/DataPacketTest.php +++ /dev/null @@ -1,47 +0,0 @@ -senderSubId = 3; - $pk->recipientSubId = 2; - - $context = new PacketSerializerContext(GlobalItemTypeDictionary::getInstance()->getDictionary()); - $serializer = PacketSerializer::encoder($context); - $pk->encode($serializer); - - $pk2 = new TestPacket(); - $pk2->decode(PacketSerializer::decoder($serializer->getBuffer(), 0, $context)); - self::assertSame($pk2->senderSubId, 3); - self::assertSame($pk2->recipientSubId, 2); - } -} diff --git a/tests/phpunit/network/mcpe/protocol/LoginPacketTest.php b/tests/phpunit/network/mcpe/protocol/LoginPacketTest.php deleted file mode 100644 index cdd20f840..000000000 --- a/tests/phpunit/network/mcpe/protocol/LoginPacketTest.php +++ /dev/null @@ -1,51 +0,0 @@ -getDictionary()); - $stream = PacketSerializer::encoder($context); - $stream->putUnsignedVarInt(ProtocolInfo::LOGIN_PACKET); - $payload = '{"chain":[]'; //intentionally malformed - $stream->putInt(ProtocolInfo::CURRENT_PROTOCOL); - - $stream2 = PacketSerializer::encoder($context); - $stream2->putLInt(strlen($payload)); - $stream2->put($payload); - $stream->putString($stream2->getBuffer()); - - $pk = PacketPool::getInstance()->getPacket($stream->getBuffer()); - - $this->expectException(PacketDecodeException::class); - $pk->decode(PacketSerializer::decoder($stream->getBuffer(), 0, $context)); //bang - } -} diff --git a/tests/phpunit/network/mcpe/protocol/ProtocolInfoTest.php b/tests/phpunit/network/mcpe/protocol/ProtocolInfoTest.php deleted file mode 100644 index e83a91983..000000000 --- a/tests/phpunit/network/mcpe/protocol/ProtocolInfoTest.php +++ /dev/null @@ -1,37 +0,0 @@ -getDictionary()); - $write = PacketBatch::fromPackets($decoderContext, ...array_fill(0, $limit + 1, new TestPacket())); - $read = new PacketBatch($write->getBuffer()); - $this->expectException(PacketDecodeException::class); - $readCount = 0; - foreach($read->getPackets(PacketPool::getInstance(), $decoderContext, $limit) as $packet){ - $readCount++; - } - } - - public function testDecodeAtLimit() : void{ - $limit = 10; - $decoderContext = new PacketSerializerContext(GlobalItemTypeDictionary::getInstance()->getDictionary()); - $write = PacketBatch::fromPackets($decoderContext, ...array_fill(0, $limit, new TestPacket())); - $read = new PacketBatch($write->getBuffer()); - $readCount = 0; - foreach($read->getPackets(PacketPool::getInstance(), $decoderContext, $limit) as $packet){ - $readCount++; - } - self::assertSame($limit, $readCount); - } -}