Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
41 lines
1.3 KiB
PHP
41 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace LIT\MCP\Tests\Support;
|
|
|
|
use LIT\MCP\Integrations\Divi\Release\CompatibilityMatrix;
|
|
use LIT\MCP\Integrations\Divi\Release\DiviFeature;
|
|
use LIT\MCP\Integrations\Divi\Release\FeatureStatus;
|
|
use LIT\MCP\Integrations\Divi\Release\ReleaseState;
|
|
|
|
/** Compatibility matrices for tests: every feature released, with single features replaced. */
|
|
final class MatrixFixtures
|
|
{
|
|
/**
|
|
* @param list<FeatureStatus> $replace Statuses that replace the released one of their feature.
|
|
*/
|
|
public static function released(string $source = 'code', array $replace = []): CompatibilityMatrix
|
|
{
|
|
$features = [];
|
|
foreach (DiviFeature::cases() as $feature) {
|
|
$features[$feature->value] = new FeatureStatus($feature, ReleaseState::Released, [], $source);
|
|
}
|
|
foreach ($replace as $status) {
|
|
$features[$status->feature->value] = $status;
|
|
}
|
|
|
|
return new CompatibilityMatrix($features);
|
|
}
|
|
|
|
/** @param string ...$problems */
|
|
public static function with(
|
|
DiviFeature $feature,
|
|
ReleaseState $state,
|
|
string $source = 'code',
|
|
string ...$problems
|
|
): CompatibilityMatrix {
|
|
return self::released($source, [new FeatureStatus($feature, $state, $problems, null)]);
|
|
}
|
|
}
|