diff --git a/.gitignore b/.gitignore index 96a78dd..636c702 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /composer.lock /google-service-account.json /phpunit.xml +.phpunit.cache diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6c22177..63a3947 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,28 +1,21 @@ - - - - tests - - - - - - src - - - src/Facades - - - - - - - - + + + + tests + + + + + + + + + + src + + + src/Facades + + diff --git a/phpunit.xml.dist.bak b/phpunit.xml.dist.bak new file mode 100644 index 0000000..6c22177 --- /dev/null +++ b/phpunit.xml.dist.bak @@ -0,0 +1,28 @@ + + + + + tests + + + + + + src + + + src/Facades + + + + + + + + + diff --git a/tests/FirebaseProjectManagerTest.php b/tests/FirebaseProjectManagerTest.php index 89a9472..4e56fb1 100644 --- a/tests/FirebaseProjectManagerTest.php +++ b/tests/FirebaseProjectManagerTest.php @@ -22,10 +22,7 @@ protected function defineEnvironment($app): void $app['config']->set('firebase.projects.app.credentials', __DIR__.'/_fixtures/service_account.json'); } - /** - * @test - */ - public function a_project_configuration_has_to_exist(): void + public function test_a_project_configuration_has_to_exist(): void { $manager = $this->app->make(FirebaseProjectManager::class); @@ -36,10 +33,7 @@ public function a_project_configuration_has_to_exist(): void $this->getAccessibleMethod($manager, 'configuration')->invoke($manager, $projectName); } - /** - * @test - */ - public function a_default_project_can_be_set(): void + public function test_a_default_project_can_be_set(): void { $manager = $this->app->make(FirebaseProjectManager::class); @@ -51,10 +45,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 - */ - public function calls_are_passed_to_default_project(): void + public function test_calls_are_passed_to_default_project(): void { $manager = $this->app->make(FirebaseProjectManager::class); @@ -63,10 +54,7 @@ public function calls_are_passed_to_default_project(): void $this->assertSame($manager->project($projectName)->auth(), $manager->auth()); } - /** - * @test - */ - public function credentials_can_be_configured_using_a_json_file(): void + public function test_credentials_can_be_configured_using_a_json_file(): void { // Reference credentials $credentialsPath = \realpath(__DIR__.'/_fixtures/service_account.json'); @@ -84,10 +72,7 @@ public function credentials_can_be_configured_using_a_json_file(): void $this->assertSame($credentials, $serviceAccount); } - /** - * @test - */ - public function json_file_credentials_can_be_used_using_the_deprecated_configuration_entry(): void + public function test_json_file_credentials_can_be_used_using_the_deprecated_configuration_entry(): void { // Reference credentials $credentialsPath = \realpath(__DIR__.'/_fixtures/service_account.json'); @@ -105,10 +90,7 @@ public function json_file_credentials_can_be_used_using_the_deprecated_configura $this->assertSame($credentials, $serviceAccount); } - /** - * @test - */ - public function credentials_can_be_configured_using_an_array(): void + public function test_credentials_can_be_configured_using_an_array(): void { // Set configuration and retrieve project $projectName = 'app'; @@ -133,10 +115,7 @@ public function credentials_can_be_configured_using_an_array(): void $this->assertSame($credentials, $serviceAccount); } - /** - * @test - */ - public function projects_can_have_different_credentials(): void + public function test_projects_can_have_different_credentials(): void { // Reference credentials $credentialsPath = \realpath(__DIR__.'/_fixtures/service_account.json'); @@ -165,10 +144,7 @@ public function projects_can_have_different_credentials(): void $this->assertSame($secondCredentials, $secondServiceAccount); } - /** - * @test - */ - public function the_realtime_database_url_can_be_configured(): void + public function test_the_realtime_database_url_can_be_configured(): void { $projectName = $this->app->config->get('firebase.default'); $this->app->config->set('firebase.projects.'.$projectName.'.database.url', $url = 'https://domain.tld'); @@ -181,10 +157,7 @@ public function the_realtime_database_url_can_be_configured(): void $this->assertSame($url, (string) $property->getValue($database)); } - /** - * @test - */ - public function the_dynamic_links_default_domain_can_be_configured(): void + public function test_the_dynamic_links_default_domain_can_be_configured(): void { $projectName = $this->app->config->get('firebase.default'); $this->app->config->set('firebase.projects.'.$projectName.'.dynamic_links.default_domain', $domain = 'https://domain.tld'); @@ -198,10 +171,7 @@ public function the_dynamic_links_default_domain_can_be_configured(): void $this->assertSame($domain, $configuredDomain); } - /** - * @test - */ - public function the_storage_default_bucket_can_be_configured(): void + public function test_the_storage_default_bucket_can_be_configured(): void { $projectName = $this->app->config->get('firebase.default'); $this->app->config->set('firebase.projects.'.$projectName.'.storage.default_bucket', $name = 'my-bucket'); @@ -213,10 +183,7 @@ public function the_storage_default_bucket_can_be_configured(): void $this->assertSame($name, $property->getValue($storage)); } - /** - * @test - */ - public function logging_can_be_configured(): void + public function test_logging_can_be_configured(): void { $projectName = $this->app->config->get('firebase.default'); $this->app->config->set('firebase.projects.'.$projectName.'.logging.http_log_channel', 'stack'); @@ -228,10 +195,7 @@ public function logging_can_be_configured(): void $this->assertNotNull($property->getValue($factory)); } - /** - * @test - */ - public function debug_logging_can_be_configured(): void + public function test_debug_logging_can_be_configured(): void { $projectName = $this->app->config->get('firebase.default'); $this->app->config->set('firebase.projects.'.$projectName.'.logging.http_debug_log_channel', 'stack'); @@ -243,10 +207,7 @@ public function debug_logging_can_be_configured(): void $this->assertNotNull($property->getValue($factory)); } - /** - * @test - */ - public function http_client_options_can_be_configured(): void + public function test_http_client_options_can_be_configured(): void { $projectName = $this->app->config->get('firebase.default'); $this->app->config->set('firebase.projects.'.$projectName.'.http_client_options.proxy', 'proxy.domain.tld'); @@ -263,10 +224,7 @@ public function http_client_options_can_be_configured(): void $this->assertSame([RetryMiddleware::class], $httpClientOptions->guzzleMiddlewares()); } - /** - * @test - */ - public function it_uses_the_laravel_cache_as_verifier_cache(): void + public function test_it_uses_the_laravel_cache_as_verifier_cache(): void { $projectName = $this->app->config->get('firebase.default'); $factory = $this->factoryForProject($projectName); @@ -276,10 +234,7 @@ public function it_uses_the_laravel_cache_as_verifier_cache(): void $this->assertInstanceOf(CacheItemPoolInterface::class, $property->getValue($factory)); } - /** - * @test - */ - public function it_overrides_the_default_firestore_database(): void + public function test_it_overrides_the_default_firestore_database(): void { config(['firebase.projects.app.firestore.database' => 'override-database']); $projectName = $this->app->config->get('firebase.default'); @@ -290,10 +245,7 @@ public function it_overrides_the_default_firestore_database(): void $this->assertEquals('override-database', $property->getValue($factory)['database']); } - /** - * @test - */ - public function it_uses_the_laravel_cache_as_auth_token_cache(): void + public function test_it_uses_the_laravel_cache_as_auth_token_cache(): void { $projectName = $this->app->config->get('firebase.default'); $factory = $this->factoryForProject($projectName); diff --git a/tests/ServiceProviderTest.php b/tests/ServiceProviderTest.php index be68a68..07ec68b 100644 --- a/tests/ServiceProviderTest.php +++ b/tests/ServiceProviderTest.php @@ -11,10 +11,7 @@ */ final class ServiceProviderTest extends TestCase { - /** - * @test - */ - public function it_provides_components(): void + public function test_it_provides_components(): void { $this->app->config->set('firebase.projects.app.credentials', \realpath(__DIR__.'/_fixtures/service_account.json')); @@ -27,10 +24,7 @@ public function it_provides_components(): void $this->assertInstanceOf(Firebase\Contract\Storage::class, $this->app->make(Firebase\Contract\Storage::class)); } - /** - * @test - */ - public function it_does_not_provide_optional_components(): void + public function test_it_does_not_provide_optional_components(): void { $this->expectException(\Throwable::class); $this->expectExceptionMessageMatches('/unable/i');