fix: lit/divi-fonts-upload reicht DiviLocked aus dem Installer durch statt write_failed
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
7e7568ea62
commit
0a76f3c196
@@ -11,9 +11,12 @@ use LIT\MCP\Integrations\Divi\Design\DiviFontsUploadAbility;
|
||||
use LIT\MCP\Integrations\Divi\Design\FontCatalog;
|
||||
use LIT\MCP\Integrations\Divi\Design\FontInstaller;
|
||||
use LIT\MCP\Integrations\Divi\Release\DiviFeature;
|
||||
use LIT\MCP\Integrations\Divi\Release\DiviLocked;
|
||||
use LIT\MCP\Integrations\Divi\Release\ReleaseState;
|
||||
use LIT\MCP\Integrations\Media\RemoteFileFetcher;
|
||||
use LIT\MCP\Limits;
|
||||
use LIT\MCP\Tests\Support\FakeChangeLog;
|
||||
use LIT\MCP\Tests\Support\ReleaseMatrices;
|
||||
use LIT\MCP\Tests\Unit\TestCase;
|
||||
use Mockery;
|
||||
use Mockery\MockInterface;
|
||||
@@ -492,4 +495,23 @@ final class DiviFontsUploadAbilityTest extends TestCase
|
||||
}
|
||||
$this->assertTempFilesRemoved();
|
||||
}
|
||||
|
||||
public function testALockFromTheInstallerPropagatesInsteadOfBecomingAWriteFailure(): void
|
||||
{
|
||||
$locked = new DiviLocked(
|
||||
ReleaseMatrices::uniform(ReleaseState::Incompatible, '5.3.0', ['x']),
|
||||
[DiviFeature::FontUpload]
|
||||
);
|
||||
$installer = self::installer();
|
||||
$installer->allows('install')->andThrow($locked);
|
||||
$installer->expects('remove')->never();
|
||||
|
||||
try {
|
||||
$this->ability($installer)->execute(self::input(['confirm' => true]));
|
||||
self::fail('DiviLocked expected');
|
||||
} catch (DiviLocked $e) {
|
||||
self::assertSame($locked, $e);
|
||||
}
|
||||
$this->assertTempFilesRemoved();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user