Skip to content

Commit

Permalink
Adapt tests to changes
Browse files Browse the repository at this point in the history
  • Loading branch information
netzknecht committed Dec 3, 2023
1 parent 3850f37 commit 54993f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/Base/PositionManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static function registerBlueprintMacros(): void
$constraints = app($constraints);
}
if (!is_array($constraints)) {
$constraints = PositionManifest::constraints($constraints);
$constraints = \Lunar\Facades\PositionManifest::constraints($constraints);
} else {
$constraints = collect($constraints)
->push('position')
Expand Down
5 changes: 2 additions & 3 deletions packages/core/tests/Unit/Models/AttributeGroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -37,7 +37,6 @@ public function can_get_associated_attributes()
'en' => 'SEO',
],
'handle' => 'seo',
'position' => 5,
]);

$this->assertCount(0, $attributeGroup->attributes);
Expand Down
4 changes: 2 additions & 2 deletions packages/core/tests/Unit/Models/AttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public function can_make_a_attribute()
$attribute = Attribute::factory()
->for(AttributeGroup::factory())
->create([
'position' => 4,
'name' => [
'en' => 'Meta Description',
],
Expand All @@ -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'));
}
}

0 comments on commit 54993f8

Please sign in to comment.