Skip to content

Commit 8eb0c6d

Browse files
committed
Fix for tests
1 parent c994260 commit 8eb0c6d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/Unit/Console/Commands/SelfHost/SelfHostTelemetryCommandTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
use Illuminate\Support\Facades\Http;
1313
use PHPUnit\Framework\Attributes\CoversClass;
1414
use PHPUnit\Framework\Attributes\UsesClass;
15-
use Tests\TestCase;
15+
use Tests\TestCaseWithDatabase;
1616

1717
#[CoversClass(SelfHostTelemetryCommand::class)]
1818
#[CoversClass(ApiService::class)]
1919
#[UsesClass(SelfHostTelemetryCommand::class)]
20-
class SelfHostTelemetryCommandTest extends TestCase
20+
class SelfHostTelemetryCommandTest extends TestCaseWithDatabase
2121
{
2222
public function test_telemetry_sends_data_to_telemetry_endpoint_of_solidtime_cloud(): void
2323
{
@@ -30,9 +30,12 @@ public function test_telemetry_sends_data_to_telemetry_endpoint_of_solidtime_clo
3030
$exitCode = $this->withoutMockingConsoleOutput()->artisan('self-host:telemetry');
3131

3232
// Assert
33-
$this->assertSame(Command::SUCCESS, $exitCode);
3433
$output = Artisan::output();
3534
$this->assertSame('', $output);
35+
if ($exitCode !== Command::SUCCESS) {
36+
dump($output);
37+
}
38+
$this->assertSame(Command::SUCCESS, $exitCode);
3639
}
3740

3841
public function test_telemetry_sends_fails_gracefully_if_response_has_error_status_code(): void

0 commit comments

Comments
 (0)