mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 01:16:15 +00:00
Item: restrict bounds of count to 0-255
This commit is contained in:
@ -89,4 +89,18 @@ class ItemTest extends TestCase{
|
||||
self::assertEquals($id, $item->getId());
|
||||
self::assertEquals($meta, $item->getDamage());
|
||||
}
|
||||
|
||||
public function testSetCountTooBig() : void{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
|
||||
$item = ItemFactory::get(ItemIds::STONE);
|
||||
$item->setCount(256);
|
||||
}
|
||||
|
||||
public function testSetCountTooSmall() : void{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
|
||||
$item = ItemFactory::get(ItemIds::STONE);
|
||||
$item->setCount(-1);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user