diff --git a/tests/StatsDAdapterServiceProviderTest.php b/tests/StatsDAdapterServiceProviderTest.php new file mode 100644 index 0000000..a703a1e --- /dev/null +++ b/tests/StatsDAdapterServiceProviderTest.php @@ -0,0 +1,44 @@ +app->make(StatsDClientAdapter::class); + + // Then + self::assertInstanceOf(DatadogStatsDClientAdapter::class, $clientAdapter); + self::assertInstanceOf(DatadogLoggingClient::class, $clientAdapter->getClient()); + } + + #[Test] + public function makeStatsDClientAdapter_returnsSingleton(): void + { + // Given application is booted + + // When + $clientAdapter = $this->app->make(StatsDClientAdapter::class); + + // Then + self::assertInstanceOf(InMemoryClientAdapter::class, $clientAdapter); + + // And + self::assertSame($clientAdapter, $this->app->make(StatsDClientAdapter::class)); + } +}