Skip to content

Commit

Permalink
interop tests: allow to restrict to single account by env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mstilkerich committed Jan 1, 2022
1 parent 510d052 commit 0cbecad
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/interop/TestInfrastructureSrv.php
Expand Up @@ -240,7 +240,13 @@ public static function init(): void
public static function accountProvider(): array
{
$ret = [];
$accountFilter = getenv('CARDDAVCLIENT_INTEROP_SRV');

foreach (AccountData::ACCOUNTS as $name => $cfg) {
if (is_string($accountFilter) && ($accountFilter != $name)) {
continue;
}

$ret[$name] = [ $name, $cfg ];
}
return $ret;
Expand All @@ -259,6 +265,8 @@ public static function accountProvider(): array
public static function addressbookProvider(bool $excludeReadOnly = true): array
{
$ret = [];
$accounts = self::accountProvider();

foreach (AccountData::ADDRESSBOOKS as $name => $cfg) {
/**
* @psalm-var 0|bool $readonly
Expand All @@ -270,7 +278,10 @@ public static function addressbookProvider(bool $excludeReadOnly = true): array
if ($excludeReadOnly && $readonly) {
continue;
}
$ret[$name] = [ $name, $cfg ];

if (isset($accounts[$cfg["account"]])) {
$ret[$name] = [ $name, $cfg ];
}
}
return $ret;
}
Expand Down

0 comments on commit 0cbecad

Please sign in to comment.