mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-19 09:51:35 +02:00
Replace DocBlocks tests markup with phpunit v11 attributes
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Services\ReleaseRadarService;
|
||||
use Illuminate\Support\Facades\Lang;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use Tests\FeatureTestCase;
|
||||
|
||||
/**
|
||||
@@ -26,9 +27,6 @@ class SystemControllerTest extends FeatureTestCase
|
||||
|
||||
protected $admin;
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function setUp() : void
|
||||
{
|
||||
parent::setUp();
|
||||
@@ -37,18 +35,14 @@ class SystemControllerTest extends FeatureTestCase
|
||||
$this->admin = User::factory()->administrator()->create();
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function test_infos_returns_unauthorized()
|
||||
{
|
||||
$response = $this->json('GET', '/system/infos')
|
||||
->assertUnauthorized();
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function test_infos_returns_forbidden()
|
||||
{
|
||||
$response = $this->actingAs($this->user, 'api-guard')
|
||||
@@ -56,9 +50,7 @@ class SystemControllerTest extends FeatureTestCase
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function test_infos_returns_only_base_collection()
|
||||
{
|
||||
$response = $this->actingAs($this->admin, 'api-guard')
|
||||
@@ -87,9 +79,7 @@ class SystemControllerTest extends FeatureTestCase
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function test_infos_returns_proxy_collection_when_signed_in_behind_proxy()
|
||||
{
|
||||
$response = $this->actingAs($this->admin, 'reverse-proxy-guard')
|
||||
@@ -104,9 +94,7 @@ class SystemControllerTest extends FeatureTestCase
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function test_latestrelease_runs_manual_scan()
|
||||
{
|
||||
$releaseRadarService = $this->mock(ReleaseRadarService::class)->makePartial();
|
||||
@@ -121,9 +109,7 @@ class SystemControllerTest extends FeatureTestCase
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function test_testEmail_sends_a_notification()
|
||||
{
|
||||
Notification::fake();
|
||||
@@ -136,9 +122,7 @@ class SystemControllerTest extends FeatureTestCase
|
||||
Notification::assertSentTo($this->admin, TestEmailSettingNotification::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function test_testEmail_renders_to_email()
|
||||
{
|
||||
$mail = (new TestEmailSettingNotification('test_token'))->toMail($this->user)->render();
|
||||
@@ -149,18 +133,14 @@ class SystemControllerTest extends FeatureTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function test_testEmail_returns_unauthorized()
|
||||
{
|
||||
$response = $this->json('GET', '/system/infos')
|
||||
->assertUnauthorized();
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function test_testEmail_returns_forbidden()
|
||||
{
|
||||
$response = $this->actingAs($this->user, 'api-guard')
|
||||
@@ -168,9 +148,7 @@ class SystemControllerTest extends FeatureTestCase
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function test_clearCache_returns_success()
|
||||
{
|
||||
$response = $this->json('GET', '/system/clear-cache');
|
||||
@@ -178,9 +156,7 @@ class SystemControllerTest extends FeatureTestCase
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function test_optimize_returns_success()
|
||||
{
|
||||
$response = $this->json('GET', '/system/optimize');
|
||||
|
Reference in New Issue
Block a user