Skip to content

Commit

Permalink
add test can attribute delete from model
Browse files Browse the repository at this point in the history
  • Loading branch information
milwad-dev committed Apr 5, 2023
1 parent 2561cc1 commit 6592e22
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/AttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,11 @@
assertDatabaseCount('products', 1);
assertNotEmpty($product->hasAttributeTitle($title));
});

test('test can attribute delete from model', function () {
$product = Product::query()->create(['title' => 'milwad-dev']);
$product->attachAttribute($title = 'role', $value = 'developer');
$product->deleteAttribute($title, $value);

assertDatabaseCount('products', 1);
});

0 comments on commit 6592e22

Please sign in to comment.