Aplicar Pint aos 18 ficheiros que falhavam lint:check
Só formatação. 16 já falhavam em fase5-producao; 2 vêm de c9bd6db.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -154,6 +154,6 @@ final class CommonReceiptStockTest extends TestCase
|
||||
file_put_contents($root.'/receipt-results.json', json_encode(['identity' => $i, 'physical_accepted_milli' => 4000, 'rejected_milli' => 2000, 'movement_count_main' => 1,
|
||||
'source_version_stale_refused' => true, 'core_replay_same_movement' => true, 'fault_atomic_and_recovered' => true, 'concurrency' => ['actual_lock_wait' => true, 'wait_event' => $wait->wait_event, 'same_receipt' => true, 'one_movement' => true],
|
||||
'link' => ['tenant' => (int) $f['tenant']->id, 'warehouse' => (int) $f['warehouse']->id, 'item' => (int) $f['stock']->id, 'movement' => (int) $movement->id, 'reference' => $movement->snapshot['reference']],
|
||||
'writer_manifest_sha256' => hash_file('sha256',base_path('packages/inventory-write/releases/0.1.0/manifest.json'))], JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
'writer_manifest_sha256' => hash_file('sha256', base_path('packages/inventory-write/releases/0.1.0/manifest.json'))], JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,10 +13,13 @@ use App\Models\Supplier;
|
||||
use App\Models\Tenant;
|
||||
use App\Models\User;
|
||||
use App\Services\ConflictGuard;
|
||||
use App\Services\ConflictReleases;
|
||||
use App\Services\RequisitionWorkflow;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
use Inertia\Testing\AssertableInertia as Assert;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Tempo\Purchasing\Composition\ExecutionContext;
|
||||
|
||||
function personalConflict(int $supplierId, ?int $requisitionId = null, bool $hasConflict = true): array
|
||||
{
|
||||
@@ -385,10 +388,10 @@ test('guests cannot consult or submit declarations', function () {
|
||||
|
||||
test('composed conflict authority is scoped and never inferred from the environment', function () {
|
||||
require_once dirname(__DIR__, 2).'/packages/purchasing/src/ExecutionContext.php';
|
||||
$execution = new \Tempo\Purchasing\Composition\ExecutionContext;
|
||||
app()->instance(\Tempo\Purchasing\Composition\ExecutionContext::class, $execution);
|
||||
$execution = new ExecutionContext;
|
||||
app()->instance(ExecutionContext::class, $execution);
|
||||
config(['conflict-releases.qa_enabled' => true]);
|
||||
$service = app(\App\Services\ConflictReleases::class);
|
||||
$service = app(ConflictReleases::class);
|
||||
expect($service->ready())->toBeFalse();
|
||||
$this->post('/conflitos', personalConflict($this->supplier->id, $this->r->id))->assertSessionHasNoErrors();
|
||||
$declaration = ConflictDeclaration::query()->firstOrFail();
|
||||
@@ -409,11 +412,11 @@ test('composed conflict authority is scoped and never inferred from the environm
|
||||
expect($service->authorise($this->admin, $declaration, $input)->id)->toBe($first->id)
|
||||
->and(ConflictRelease::query()->count())->toBe(1);
|
||||
DB::table('organization_memberships')->where('user_id', $this->admin->id)->delete();
|
||||
expect(fn () => $service->authorise($this->admin, $declaration, $input))->toThrow(\Symfony\Component\HttpKernel\Exception\HttpException::class);
|
||||
expect(fn () => $service->authorise($this->admin, $declaration, $input))->toThrow(HttpException::class);
|
||||
});
|
||||
expect($service->ready())->toBeFalse()->and($declaration->fresh()->getAttributes())->toBe($before);
|
||||
} finally {
|
||||
app()->instance('env', 'testing');
|
||||
app()->forgetInstance(\Tempo\Purchasing\Composition\ExecutionContext::class);
|
||||
app()->forgetInstance(ExecutionContext::class);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -273,11 +273,11 @@ final class NativePayablePageTest extends TestCase
|
||||
$pipes = [];
|
||||
$environment = getenv();
|
||||
$environment['COMMON_PAYABLES_PATH'] = base_path('packages/payables');
|
||||
$p = proc_open([PHP_BINARY, base_path('tests/Support/native-payable-page-worker.php'), $input],[0 => ['pipe', 'r'], 1 => ['file', $dir.'/stdout', 'w'], 2 => ['file', $dir.'/stderr', 'w']],$pipes,base_path(),$environment);
|
||||
$p = proc_open([PHP_BINARY, base_path('tests/Support/native-payable-page-worker.php'), $input], [0 => ['pipe', 'r'], 1 => ['file', $dir.'/stdout', 'w'], 2 => ['file', $dir.'/stderr', 'w']], $pipes, base_path(), $environment);
|
||||
$this->assertIsResource($p);
|
||||
fclose($pipes[0]);
|
||||
$this->assertSame(0,proc_close($p));
|
||||
$r = json_decode(file_get_contents($input.'.result'),true);
|
||||
$this->assertSame(503,$r['status']);
|
||||
$this->assertSame(0, proc_close($p));
|
||||
$r = json_decode(file_get_contents($input.'.result'), true);
|
||||
$this->assertSame(503, $r['status']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -562,16 +562,16 @@ final class WarehouseReturnIntegrationTest extends TestCase
|
||||
});
|
||||
$first = $this->getJson('/api/stock-returns')->assertOk()->assertJsonPath('pagination.total', 51)->assertJsonPath('pagination.last_page', 3)->assertJsonCount(25, 'rows')->json('rows');
|
||||
$capture = false;
|
||||
$this->assertLessThanOrEqual(4,count($queries));
|
||||
$second = $this->getJson('/api/stock-returns?page=2')->assertOk()->assertJsonCount(25,'rows')->json('rows');
|
||||
$this->assertEmpty(array_intersect(array_column($first,'id'),array_column($second,'id')));
|
||||
$this->assertGreaterThan($second[0]['id'],$first[24]['id']);
|
||||
$this->getJson('/api/stock-returns?page=3')->assertOk()->assertJsonCount(1,'rows');
|
||||
$this->assertLessThanOrEqual(4, count($queries));
|
||||
$second = $this->getJson('/api/stock-returns?page=2')->assertOk()->assertJsonCount(25, 'rows')->json('rows');
|
||||
$this->assertEmpty(array_intersect(array_column($first, 'id'), array_column($second, 'id')));
|
||||
$this->assertGreaterThan($second[0]['id'], $first[24]['id']);
|
||||
$this->getJson('/api/stock-returns?page=3')->assertOk()->assertJsonCount(1, 'rows');
|
||||
$this->actingAs($this->f['receiver']);
|
||||
$this->confirm($p)->assertOk();
|
||||
$this->getJson('/api/stock-returns?state=prepared')->assertOk()->assertJsonPath('pagination.total',50);
|
||||
$this->getJson('/api/stock-returns?state=confirmed')->assertOk()->assertJsonPath('pagination.total',1);
|
||||
$this->assertSame(8000,$this->balance());
|
||||
file_put_contents((string) getenv('STOCK_RECEIPT_ROOT').'/return-history-metrics.json',json_encode(['fixture_records' => 51, 'page_size' => 25, 'supply_record_selects_for_page' => count($queries), 'pages_disjoint' => true, 'state_filters_cover_latest_versions' => true, 'not_a_load_capacity_benchmark' => true],JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
$this->getJson('/api/stock-returns?state=prepared')->assertOk()->assertJsonPath('pagination.total', 50);
|
||||
$this->getJson('/api/stock-returns?state=confirmed')->assertOk()->assertJsonPath('pagination.total', 1);
|
||||
$this->assertSame(8000, $this->balance());
|
||||
file_put_contents((string) getenv('STOCK_RECEIPT_ROOT').'/return-history-metrics.json', json_encode(['fixture_records' => 51, 'page_size' => 25, 'supply_record_selects_for_page' => count($queries), 'pages_disjoint' => true, 'state_filters_cover_latest_versions' => true, 'not_a_load_capacity_benchmark' => true], JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user