fix: capture mobileApp scope tags

This commit is contained in:
Ahmed Darrazi 2025-12-29 14:30:08 +01:00
parent 2e6e772ef9
commit c499d93062
3 changed files with 6 additions and 1 deletions

View File

@ -319,7 +319,7 @@
],
'mobileApp' => [
'resource' => 'deviceAppManagement/mobileApps',
'allowed_select' => ['id', 'displayName', 'publisher', 'description', '@odata.type', 'createdDateTime', 'lastModifiedDateTime'],
'allowed_select' => ['id', 'displayName', 'publisher', 'description', '@odata.type', 'createdDateTime', 'lastModifiedDateTime', 'roleScopeTagIds'],
'allowed_expand' => [],
'type_family' => [
'#microsoft.graph.mobileApp',

View File

@ -106,6 +106,7 @@
$contract = $this->registry->get('mobileApp');
expect($contract)->not->toBeEmpty();
expect($contract['allowed_select'] ?? [])->toContain('roleScopeTagIds');
expect($contract['assignments_list_path'] ?? null)
->toBe('/deviceAppManagement/mobileApps/{id}/assignments');
expect($contract['assignments_create_path'] ?? null)

View File

@ -34,6 +34,7 @@ public function getPolicy(string $policyType, string $policyId, array $options =
'@odata.type' => '#microsoft.graph.win32LobApp',
'createdDateTime' => '2025-01-01T00:00:00Z',
'lastModifiedDateTime' => '2025-01-02T00:00:00Z',
'roleScopeTagIds' => ['0', 'tag-1', 'tag-2'],
'installCommandLine' => 'setup.exe /quiet',
'largeIcon' => ['type' => 'image/png', 'value' => '...'],
],
@ -155,7 +156,9 @@ public function request(string $method, string $path, array $options = []): Grap
'@odata.type',
'createdDateTime',
'lastModifiedDateTime',
'roleScopeTagIds',
]);
expect($result['payload']['roleScopeTagIds'])->toBe(['0', 'tag-1', 'tag-2']);
expect($result['payload'])->not->toHaveKey('installCommandLine');
expect($result['payload'])->not->toHaveKey('largeIcon');
expect($client->requests[0][0])->toBe('getPolicy');
@ -163,5 +166,6 @@ public function request(string $method, string $path, array $options = []): Grap
expect($client->requests[0][2])->toBe('app-123');
expect($client->requests[0][3]['select'] ?? null)->toBeArray();
expect($client->requests[0][3]['select'])->toContain('displayName');
expect($client->requests[0][3]['select'])->toContain('roleScopeTagIds');
expect($client->requests[0][3]['select'])->not->toContain('@odata.type');
});