Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the tests #18

Open
Yannx79 opened this issue May 12, 2024 · 0 comments
Open

Fix the tests #18

Yannx79 opened this issue May 12, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Yannx79
Copy link
Owner

Yannx79 commented May 12, 2024

<?php

namespace Tests\Feature;

use App\Models\Course;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;

class CourseTest extends TestCase
{
    /**
     * A basic feature test example.
     */
    public function test_index()
    {
        $this->get('courses')
            ->assertOk();
    }

    public function test_store()
    {
        $this->post('courses', [])
            ->assertCreated();
    }

    public function test_show()
    {
        $course = Course::factory()->create();
        $this->get('courses' . '/' . $course->id)
            ->assertOk();
    }

    public function test_destroy()
    {
        $course = Course::factory()->create();
        $this->delete('courses'.'/'. $course->id)
            ->assertNoContent();
    }
}

@Yannx79 Yannx79 added enhancement New feature or request help wanted Extra attention is needed labels May 12, 2024
@Yannx79 Yannx79 added this to the Business logic milestone May 12, 2024
@Yannx79 Yannx79 self-assigned this May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant