Replace DocBlocks tests markup with phpunit v11 attributes

This commit is contained in:
Bubka
2024-06-26 14:29:13 +02:00
parent cced8dbaff
commit 1a752d1243
78 changed files with 624 additions and 1681 deletions

View File

@@ -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');