Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Jun 3, 2024
1 parent efbe5e7 commit 51aa060
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 26 deletions.
26 changes: 0 additions & 26 deletions tests/Feature/HomePageTest.php

This file was deleted.

45 changes: 45 additions & 0 deletions tests/Feature/PagesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

declare(strict_types=1);

namespace Tests\Feature;

use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;

class PagesTest extends TestCase
{
public function test_it_redirects_to_the_default_locale(): void
{
$this->get('/')
->assertRedirect('/' . config('app.fallback_locale'));
}

#[DataProvider('languages')]
public function test_it_can_view_the_home_page_in(string $language)
{
$this->get("/{$language}")
->assertStatus(200);
}

#[DataProvider('languages')]
public function test_it_can_view_the_about_page_in(string $language)
{
$this->get("/{$language}/about")
->assertStatus(200);
}

#[DataProvider('languages')]
public function test_it_can_view_the_privacy_page_in(string $language)
{
$this->get("/{$language}/privacy")
->assertStatus(200);
}

#[DataProvider('languages')]
public function test_it_can_view_the_terms_page_in(string $language)
{
$this->get("/{$language}/terms")
->assertStatus(200);
}
}
7 changes: 7 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

abstract class TestCase extends BaseTestCase
{
protected function setUp(): void
{
parent::setUp();

$this->withoutVite();
}

public static function languages(): array
{
return [
Expand Down

0 comments on commit 51aa060

Please sign in to comment.