diff --git a/composer.json b/composer.json index 0f96591..fc96856 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "require-dev": { "orchestra/testbench": "^9.0", "laravel/pint": "^1.14", - "phpunit/phpunit": "^9.6.17 || ^10.5.13" + "phpunit/phpunit": "^11.4.3" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6c22177..a6f8686 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,9 +1,9 @@ @@ -11,14 +11,14 @@ - + - src + src src/Facades - + diff --git a/tests/FirebaseProjectManagerTest.php b/tests/FirebaseProjectManagerTest.php index 89a9472..11523ee 100644 --- a/tests/FirebaseProjectManagerTest.php +++ b/tests/FirebaseProjectManagerTest.php @@ -9,6 +9,7 @@ use Kreait\Firebase\Exception\InvalidArgumentException; use Kreait\Firebase\Factory; use Kreait\Laravel\Firebase\FirebaseProjectManager; +use PHPUnit\Framework\Attributes\Test; use Psr\Cache\CacheItemPoolInterface; use ReflectionObject; @@ -22,9 +23,7 @@ protected function defineEnvironment($app): void $app['config']->set('firebase.projects.app.credentials', __DIR__.'/_fixtures/service_account.json'); } - /** - * @test - */ + #[Test] public function a_project_configuration_has_to_exist(): void { $manager = $this->app->make(FirebaseProjectManager::class); @@ -36,9 +35,7 @@ public function a_project_configuration_has_to_exist(): void $this->getAccessibleMethod($manager, 'configuration')->invoke($manager, $projectName); } - /** - * @test - */ + #[Test] public function a_default_project_can_be_set(): void { $manager = $this->app->make(FirebaseProjectManager::class); @@ -51,9 +48,7 @@ public function a_default_project_can_be_set(): void $this->assertSame($projectName, $this->app->config->get('firebase.default'), 'default project should be set in config'); } - /** - * @test - */ + #[Test] public function calls_are_passed_to_default_project(): void { $manager = $this->app->make(FirebaseProjectManager::class); @@ -63,9 +58,7 @@ public function calls_are_passed_to_default_project(): void $this->assertSame($manager->project($projectName)->auth(), $manager->auth()); } - /** - * @test - */ + #[Test] public function credentials_can_be_configured_using_a_json_file(): void { // Reference credentials @@ -84,9 +77,7 @@ public function credentials_can_be_configured_using_a_json_file(): void $this->assertSame($credentials, $serviceAccount); } - /** - * @test - */ + #[Test] public function json_file_credentials_can_be_used_using_the_deprecated_configuration_entry(): void { // Reference credentials @@ -105,9 +96,7 @@ public function json_file_credentials_can_be_used_using_the_deprecated_configura $this->assertSame($credentials, $serviceAccount); } - /** - * @test - */ + #[Test] public function credentials_can_be_configured_using_an_array(): void { // Set configuration and retrieve project @@ -133,9 +122,7 @@ public function credentials_can_be_configured_using_an_array(): void $this->assertSame($credentials, $serviceAccount); } - /** - * @test - */ + #[Test] public function projects_can_have_different_credentials(): void { // Reference credentials @@ -165,9 +152,7 @@ public function projects_can_have_different_credentials(): void $this->assertSame($secondCredentials, $secondServiceAccount); } - /** - * @test - */ + #[Test] public function the_realtime_database_url_can_be_configured(): void { $projectName = $this->app->config->get('firebase.default'); @@ -181,9 +166,7 @@ public function the_realtime_database_url_can_be_configured(): void $this->assertSame($url, (string) $property->getValue($database)); } - /** - * @test - */ + #[Test] public function the_dynamic_links_default_domain_can_be_configured(): void { $projectName = $this->app->config->get('firebase.default'); @@ -198,9 +181,7 @@ public function the_dynamic_links_default_domain_can_be_configured(): void $this->assertSame($domain, $configuredDomain); } - /** - * @test - */ + #[Test] public function the_storage_default_bucket_can_be_configured(): void { $projectName = $this->app->config->get('firebase.default'); @@ -213,9 +194,7 @@ public function the_storage_default_bucket_can_be_configured(): void $this->assertSame($name, $property->getValue($storage)); } - /** - * @test - */ + #[Test] public function logging_can_be_configured(): void { $projectName = $this->app->config->get('firebase.default'); @@ -228,9 +207,7 @@ public function logging_can_be_configured(): void $this->assertNotNull($property->getValue($factory)); } - /** - * @test - */ + #[Test] public function debug_logging_can_be_configured(): void { $projectName = $this->app->config->get('firebase.default'); @@ -243,9 +220,7 @@ public function debug_logging_can_be_configured(): void $this->assertNotNull($property->getValue($factory)); } - /** - * @test - */ + #[Test] public function http_client_options_can_be_configured(): void { $projectName = $this->app->config->get('firebase.default'); @@ -263,9 +238,7 @@ public function http_client_options_can_be_configured(): void $this->assertSame([RetryMiddleware::class], $httpClientOptions->guzzleMiddlewares()); } - /** - * @test - */ + #[Test] public function it_uses_the_laravel_cache_as_verifier_cache(): void { $projectName = $this->app->config->get('firebase.default'); @@ -276,9 +249,7 @@ public function it_uses_the_laravel_cache_as_verifier_cache(): void $this->assertInstanceOf(CacheItemPoolInterface::class, $property->getValue($factory)); } - /** - * @test - */ + #[Test] public function it_overrides_the_default_firestore_database(): void { config(['firebase.projects.app.firestore.database' => 'override-database']); @@ -290,9 +261,7 @@ public function it_overrides_the_default_firestore_database(): void $this->assertEquals('override-database', $property->getValue($factory)['database']); } - /** - * @test - */ + #[Test] public function it_uses_the_laravel_cache_as_auth_token_cache(): void { $projectName = $this->app->config->get('firebase.default'); diff --git a/tests/ServiceProviderTest.php b/tests/ServiceProviderTest.php index be68a68..3624e7e 100644 --- a/tests/ServiceProviderTest.php +++ b/tests/ServiceProviderTest.php @@ -5,15 +5,14 @@ namespace Kreait\Laravel\Firebase\Tests; use Kreait\Firebase; +use PHPUnit\Framework\Attributes\Test; /** * @internal */ final class ServiceProviderTest extends TestCase { - /** - * @test - */ + #[Test] public function it_provides_components(): void { $this->app->config->set('firebase.projects.app.credentials', \realpath(__DIR__.'/_fixtures/service_account.json')); @@ -27,9 +26,7 @@ public function it_provides_components(): void $this->assertInstanceOf(Firebase\Contract\Storage::class, $this->app->make(Firebase\Contract\Storage::class)); } - /** - * @test - */ + #[Test] public function it_does_not_provide_optional_components(): void { $this->expectException(\Throwable::class);