From e0a07e479af14c068191e168a596364df400355e Mon Sep 17 00:00:00 2001 From: netzknecht Date: Sun, 3 Dec 2023 02:28:33 +0000 Subject: [PATCH] Adapt tests to changes --- packages/core/tests/Unit/Models/AttributeGroupTest.php | 5 ++--- packages/core/tests/Unit/Models/AttributeTest.php | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/core/tests/Unit/Models/AttributeGroupTest.php b/packages/core/tests/Unit/Models/AttributeGroupTest.php index 51f50dd622..cce6172807 100644 --- a/packages/core/tests/Unit/Models/AttributeGroupTest.php +++ b/packages/core/tests/Unit/Models/AttributeGroupTest.php @@ -20,12 +20,12 @@ public function can_make_a_attribute_group() 'en' => 'SEO', ], 'handle' => 'seo', - 'position' => 5, ]); $this->assertEquals('SEO', $attributeGroup->name->get('en')); $this->assertEquals('seo', $attributeGroup->handle); - $this->assertEquals(5, $attributeGroup->position); + $this->assertIsInt($attributeGroup->position); + $this->assertGreaterThan(0, $attributeGroup->position); } /** @test */ @@ -37,7 +37,6 @@ public function can_get_associated_attributes() 'en' => 'SEO', ], 'handle' => 'seo', - 'position' => 5, ]); $this->assertCount(0, $attributeGroup->attributes); diff --git a/packages/core/tests/Unit/Models/AttributeTest.php b/packages/core/tests/Unit/Models/AttributeTest.php index f95bfe68d0..0517a8cf64 100644 --- a/packages/core/tests/Unit/Models/AttributeTest.php +++ b/packages/core/tests/Unit/Models/AttributeTest.php @@ -23,7 +23,6 @@ public function can_make_a_attribute() $attribute = Attribute::factory() ->for(AttributeGroup::factory()) ->create([ - 'position' => 4, 'name' => [ 'en' => 'Meta Description', ], @@ -42,7 +41,8 @@ public function can_make_a_attribute() $this->assertEquals('meta_description', $attribute->handle); $this->assertEquals(\Lunar\FieldTypes\Text::class, $attribute->type); $this->assertTrue($attribute->system); - $this->assertEquals(4, $attribute->position); + $this->assertIsInt($attribute->position); + $this->assertGreaterThan(0, $attribute->position); $this->assertEquals($options, $attribute->configuration->get('options')); } }