Skip to content

Commit

Permalink
add test can delete all attributes of one model
Browse files Browse the repository at this point in the history
  • Loading branch information
milwad-dev committed Apr 5, 2023
1 parent 6592e22 commit d50d300
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/AttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,12 @@

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

test('test can delete all attributes of one model', function () {
$product = Product::query()->create(['title' => 'milwad-dev']);
$product->attachAttribute('role', 'developer');
$product->attachAttribute('stack', 'laravel');
$product->deleteAllAttribute();

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

0 comments on commit d50d300

Please sign in to comment.