Skip to content

Commit

Permalink
unit/controller
Browse files Browse the repository at this point in the history
  • Loading branch information
realodix committed May 17, 2024
1 parent e079596 commit 3161459
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions tests/Unit/Controllers/UrlControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
namespace Tests\Unit\Controllers;

use App\Models\Url;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;

#[\PHPUnit\Framework\Attributes\Group('controller')]
class UrlControllerTest extends TestCase
{
/**
* When the guest (users who are not logged in) shortens the URL, the user_id column
* (Urls table) must be filled with a null value.
*/
#[Test]
#[Group('u-controller')]
public function guestShortenURL(): void
{
$longUrl = 'https://laravel.com';
Expand All @@ -30,7 +29,6 @@ public function guestShortenURL(): void
* the authenticated user id.
*/
#[Test]
#[Group('u-controller')]
public function userShortenURL(): void
{
$user = $this->normalUser();
Expand All @@ -44,7 +42,6 @@ public function userShortenURL(): void
}

#[Test]
#[Group('u-controller')]
public function showDetail(): void
{
$url = Url::factory()->create();
Expand Down
3 changes: 1 addition & 2 deletions tests/Unit/Controllers/UrlRedirectControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@

use App\Models\Url;
use App\Models\Visit;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;

#[\PHPUnit\Framework\Attributes\Group('controller')]
class UrlRedirectControllerTest extends TestCase
{
#[Test]
#[Group('u-controller')]
public function urlRedirection(): void
{
$url = Url::factory()->create();
Expand Down

0 comments on commit 3161459

Please sign in to comment.