5
5
use Illuminate \Config \Repository ;
6
6
use MarkWalet \Packagist \Facades \Packagist ;
7
7
use MarkWalet \Packagist \PackagistServiceProvider ;
8
+ use PHPUnit \Framework \Attributes \Test ;
8
9
use Spatie \Packagist \PackagistClient ;
9
10
use Spatie \Packagist \PackagistUrlGenerator ;
10
11
11
12
class PackagistServiceProviderTest extends LaravelTestCase
12
13
{
13
- /** @test */
14
- public function it_binds_a_packagist_client_to_the_application ()
14
+ #[Test]
15
+ public function it_binds_a_packagist_client_to_the_application (): void
15
16
{
16
17
$ bindings = $ this ->app ->getBindings ();
17
18
$ this ->assertArrayHasKey (PackagistClient::class, $ bindings );
@@ -20,8 +21,8 @@ public function it_binds_a_packagist_client_to_the_application()
20
21
$ this ->assertInstanceOf (PackagistClient::class, $ result );
21
22
}
22
23
23
- /** @test */
24
- public function it_binds_a_url_generator_to_the_application ()
24
+ #[Test]
25
+ public function it_binds_a_url_generator_to_the_application (): void
25
26
{
26
27
$ bindings = $ this ->app ->getBindings ();
27
28
$ this ->assertArrayHasKey (PackagistUrlGenerator::class, $ bindings );
@@ -30,8 +31,8 @@ public function it_binds_a_url_generator_to_the_application()
30
31
$ this ->assertInstanceOf (PackagistUrlGenerator::class, $ result );
31
32
}
32
33
33
- /** @test */
34
- public function the_service_provider_only_loads_when_one_of_the_bound_classes_should_be_injected ()
34
+ #[Test]
35
+ public function the_service_provider_only_loads_when_one_of_the_bound_classes_should_be_injected (): void
35
36
{
36
37
$ provider = new PackagistServiceProvider ($ this ->app );
37
38
@@ -43,8 +44,8 @@ public function the_service_provider_only_loads_when_one_of_the_bound_classes_sh
43
44
], $ result );
44
45
}
45
46
46
- /** @test */
47
- public function it_registers_a_facade ()
47
+ #[Test]
48
+ public function it_registers_a_facade (): void
48
49
{
49
50
$ this ->app ->bind (PackagistClient::class, function () {
50
51
$ client = $ this ->getMockBuilder (PackagistClient::class)
@@ -67,8 +68,8 @@ public function it_registers_a_facade()
67
68
$ this ->assertEquals (['result ' => 'ok ' ], $ result );
68
69
}
69
70
70
- /** @test */
71
- public function it_uses_the_default_configuration_when_no_url_is_set ()
71
+ #[Test]
72
+ public function it_uses_the_default_configuration_when_no_url_is_set (): void
72
73
{
73
74
/** @var PackagistUrlGenerator $generator */
74
75
$ generator = $ this ->app ->make (PackagistUrlGenerator::class);
@@ -80,8 +81,8 @@ public function it_uses_the_default_configuration_when_no_url_is_set()
80
81
$ this ->assertEquals ('https://repo.packagist.org/test.json ' , $ repoResult );
81
82
}
82
83
83
- /** @test */
84
- public function it_can_override_the_url_configuration ()
84
+ #[Test]
85
+ public function it_can_override_the_url_configuration (): void
85
86
{
86
87
/** @var Repository $config */
87
88
$ config = $ this ->app ['config ' ];
0 commit comments