Changes output to JSON serialization.

This commit is contained in:
Joao Patricio
2023-04-07 15:58:45 +01:00
parent 2a8d603f98
commit e6f0059e5e
10 changed files with 62 additions and 130 deletions

View File

@@ -1,7 +1,6 @@
<?php
use App\Actions\RemoteProcess\RunRemoteProcess;
use App\Actions\RemoteProcess\TidyOutput;
use App\Models\Server;
use Database\Seeders\DatabaseSeeder;
use Illuminate\Foundation\Testing\DatabaseMigrations;
@@ -24,13 +23,10 @@ it('outputs correctly', function () {
], $host);
preg_match(RunRemoteProcess::MARK_REGEX, $activity->description, $matchesInRawContent);
$out = (new TidyOutput($activity))();
preg_match(RunRemoteProcess::MARK_REGEX, $out, $matchesInTidyOutput);
expect($matchesInRawContent)
->not()->toBeEmpty()
->and($matchesInTidyOutput)
->toBeEmpty();
$tidyOutput = RunRemoteProcess::decodeOutput($activity);
expect($tidyOutput)
->toContain('Welcome 1 times')
->toContain('Welcome 3 times')
->not()->toBeJson();
});