Skip to content

Commit 13180e5

Browse files
committed
Fix for tests
1 parent c994260 commit 13180e5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
use Illuminate\Http\Client\ConnectionException;
1111
use Illuminate\Support\Facades\Artisan;
1212
use Illuminate\Support\Facades\Http;
13+
use Illuminate\Support\Facades\Log;
1314
use PHPUnit\Framework\Attributes\CoversClass;
1415
use PHPUnit\Framework\Attributes\UsesClass;
1516
use Tests\TestCase;
17+
use Tests\TestCaseWithDatabase;
1618

1719
#[CoversClass(SelfHostTelemetryCommand::class)]
1820
#[CoversClass(ApiService::class)]
1921
#[UsesClass(SelfHostTelemetryCommand::class)]
20-
class SelfHostTelemetryCommandTest extends TestCase
22+
class SelfHostTelemetryCommandTest extends TestCaseWithDatabase
2123
{
2224
public function test_telemetry_sends_data_to_telemetry_endpoint_of_solidtime_cloud(): void
2325
{
@@ -30,9 +32,12 @@ public function test_telemetry_sends_data_to_telemetry_endpoint_of_solidtime_clo
3032
$exitCode = $this->withoutMockingConsoleOutput()->artisan('self-host:telemetry');
3133

3234
// Assert
33-
$this->assertSame(Command::SUCCESS, $exitCode);
3435
$output = Artisan::output();
3536
$this->assertSame('', $output);
37+
if ($exitCode !== Command::SUCCESS) {
38+
dump($output);
39+
}
40+
$this->assertSame(Command::SUCCESS, $exitCode);
3641
}
3742

3843
public function test_telemetry_sends_fails_gracefully_if_response_has_error_status_code(): void

0 commit comments

Comments
 (0)