fix(audit L4): Restore-Planer für Farben, Variablen und Presets berechnen die Fundstellen (affected, P8a blocked_ids) für geänderte, entfernte und deaktivierte Einträge
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
4a8a889f93
commit
bd80ab1394
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Tests\Support;
|
||||
|
||||
use LIT\MCP\Integrations\Divi\Library\GlobalUsages;
|
||||
use LIT\MCP\Integrations\Divi\Library\UsageReport;
|
||||
use Mockery;
|
||||
use Mockery\MockInterface;
|
||||
|
||||
/** GlobalUsages stand-ins for the design planners (audit L4). */
|
||||
final class UsageFixture
|
||||
{
|
||||
/** Nothing uses anything. */
|
||||
public static function none(): GlobalUsages&MockInterface
|
||||
{
|
||||
return self::reporting(new UsageReport(0, [], 0, 0, [], 0, false));
|
||||
}
|
||||
|
||||
/** Live post 7 uses everything and the caller may not edit it (ruling P8a). */
|
||||
public static function blocked(): GlobalUsages&MockInterface
|
||||
{
|
||||
return self::reporting(self::blockedReport());
|
||||
}
|
||||
|
||||
public static function blockedReport(): UsageReport
|
||||
{
|
||||
return new UsageReport(
|
||||
1,
|
||||
[['post_id' => 7, 'title' => 'Start', 'status' => 'publish', 'type' => 'page']],
|
||||
0,
|
||||
1,
|
||||
[7],
|
||||
0,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
public static function reporting(UsageReport $report): GlobalUsages&MockInterface
|
||||
{
|
||||
$usages = Mockery::mock(GlobalUsages::class);
|
||||
$usages->allows('reportFor')->andReturn($report);
|
||||
|
||||
return $usages;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user