From 2da2fdd6d47f484704c471c3dfac6559c4ed4d23 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 29 Oct 2018 12:42:03 +0000 Subject: [PATCH] Added a test for Item->equals() when both items have no NBT --- tests/phpunit/item/ItemTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/phpunit/item/ItemTest.php b/tests/phpunit/item/ItemTest.php index f1be994f3..b519dcaaa 100644 --- a/tests/phpunit/item/ItemTest.php +++ b/tests/phpunit/item/ItemTest.php @@ -43,6 +43,15 @@ class ItemTest extends TestCase{ self::assertTrue($item->equals($item2)); } + /** + * Test that same items without NBT are considered equal + */ + public function testItemEqualsNoNbt() : void{ + $item1 = ItemFactory::get(Item::DIAMOND_SWORD); + $item2 = clone $item1; + self::assertTrue($item1->equals($item2)); + } + /** * Tests that blocks are considered to be valid registered items */