Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
184,853 changes: 184,852 additions & 1 deletion assets/acquia-v3-spec.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/acquia-v3-spec.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
199d128f014624cedeed3a984d059ee7e064596f
9334f85250729078f6fefbae153bc37d6cfe788c
17 changes: 14 additions & 3 deletions tests/phpunit/src/Commands/Api/ApiV3CommandHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@ public function testNoDuplicateCommandNames(): void
/**
* The generator must produce one command per operation that declares a CLI name
* (either legacy x-cli-name or x-acquia-exposure.channels.cli.command),
* plus autogenerated ApiList wrappers for each sub-namespace.
* excluding operations that ApiV3CommandHelper::shouldSkipOperation() would drop
* (cli.enabled === false or audience declared without "public").
*/
public function testCommandCountMatchesOperationCountInSpec(): void
{
Expand All @@ -423,9 +424,19 @@ public function testCommandCountMatchesOperationCountInSpec(): void
}
$hasLegacy = isset($op['x-cli-name']);
$hasNew = isset($op['x-acquia-exposure']['channels']['cli']['command']);
if ($hasLegacy || $hasNew) {
$expectedOps++;
if (!$hasLegacy && !$hasNew) {
continue;
}
// Mirror ApiV3CommandHelper::shouldSkipOperation().
$cli = $op['x-acquia-exposure']['channels']['cli'] ?? null;
if ($cli !== null && ($cli['enabled'] ?? true) === false) {
continue;
}
$audience = $op['x-acquia-exposure']['audience'] ?? null;
if ($audience !== null && !in_array('public', $audience, true)) {
continue;
}
$expectedOps++;
}
}

Expand Down
Loading