1
0
mirror of https://github.com/Kovah/LinkAce.git synced 2025-03-15 12:19:39 +01:00
LinkAce/tests/Models/NoteDeleteTest.php
Kovah 113b30120d
Update to Laravel 8, refactor tests to use new factory classes
Also updates all other needed packages.
2020-11-08 20:10:42 +01:00

38 lines
751 B
PHP

<?php
namespace Tests\Models;
use App\Models\Note;
use App\Models\User;
use App\Repositories\NoteRepository;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
class NoteDeleteTest extends TestCase
{
use DatabaseMigrations;
use DatabaseTransactions;
/** @var User */
private $user;
public function setUp(): void
{
parent::setUp();
$this->user = User::factory()->create();
}
public function testValidCategoryCreation(): void
{
$this->be($this->user);
$note = Note::factory()->create();
$deletionResult = NoteRepository::delete($note);
$this->assertTrue($deletionResult);
}
}