## Summary - move the Laravel application into `apps/platform` and keep the repository root for orchestration, docs, and tooling - update the local command model, Sail/Docker wiring, runtime paths, and ignore rules around the new platform location - add relocation quickstart/contracts plus focused smoke coverage for bootstrap, command model, routes, and runtime behavior ## Validation - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/PlatformRelocation` - integrated browser smoke validated `/up`, `/`, `/admin`, `/admin/choose-workspace`, and tenant route semantics for `200`, `403`, and `404` ## Remaining Rollout Checks - validate Dokploy build context and working-directory assumptions against the new `apps/platform` layout - confirm web, queue, and scheduler processes all start from the expected working directory in staging/production - verify no legacy volume mounts or asset-publish paths still point at the old root-level `public/` or `storage/` locations Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #213
64 lines
2.1 KiB
PHP
64 lines
2.1 KiB
PHP
<?php
|
|
|
|
use App\Services\Graph\GraphContractRegistry;
|
|
use App\Services\Graph\GraphLogger;
|
|
use App\Services\Graph\MicrosoftGraphClient;
|
|
use Illuminate\Http\Client\Request;
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
beforeEach(function () {
|
|
config()->set('graph_contracts.types.deviceConfiguration', [
|
|
'resource' => 'deviceManagement/deviceConfigurations',
|
|
'allowed_select' => ['id', 'displayName'],
|
|
'allowed_expand' => [],
|
|
'type_family' => ['#microsoft.graph.deviceConfiguration'],
|
|
]);
|
|
|
|
config()->set('graph.base_url', 'https://graph.microsoft.com');
|
|
config()->set('graph.version', 'beta');
|
|
config()->set('graph.tenant_id', 'tenant');
|
|
config()->set('graph.client_id', 'client');
|
|
config()->set('graph.client_secret', 'secret');
|
|
config()->set('graph.scope', 'https://graph.microsoft.com/.default');
|
|
});
|
|
|
|
it('falls back when capability errors occur on select', function () {
|
|
$callCount = 0;
|
|
|
|
Http::fake([
|
|
'https://login.microsoftonline.com/*' => Http::response([
|
|
'access_token' => 'fake-token',
|
|
'expires_in' => 3600,
|
|
], 200),
|
|
'https://graph.microsoft.com/*' => function (Request $request) use (&$callCount) {
|
|
$callCount++;
|
|
|
|
if ($callCount === 1) {
|
|
return Http::response([
|
|
'error' => [
|
|
'code' => 'Request_BadRequest',
|
|
'message' => 'Request is invalid due to $select',
|
|
],
|
|
], 400);
|
|
}
|
|
|
|
return Http::response(['id' => 'policy-1', 'displayName' => 'Policy'], 200);
|
|
},
|
|
]);
|
|
|
|
$client = new MicrosoftGraphClient(
|
|
logger: app(GraphLogger::class),
|
|
contracts: app(GraphContractRegistry::class),
|
|
);
|
|
|
|
$response = $client->getPolicy('deviceConfiguration', 'policy-1', [
|
|
'select' => ['id', 'displayName', 'unsupported'],
|
|
'tenant' => 'tenant',
|
|
'access_token' => 'token',
|
|
]);
|
|
|
|
expect($response->successful())->toBeTrue();
|
|
expect($callCount)->toBe(2);
|
|
expect($response->warnings)->not->toBeEmpty();
|
|
});
|