fix: DockerSecretsResolver - don't normalize absolute paths like /var/www/html/...
Some checks failed
Deploy Application / deploy (push) Has been cancelled

This commit is contained in:
2025-11-24 21:28:25 +01:00
parent 4eb7134853
commit 77abc65cd7
1327 changed files with 91915 additions and 9909 deletions

View File

@@ -0,0 +1,101 @@
<?php
declare(strict_types=1);
namespace Tests\Feature\Framework\LiveComponents\E2E;
use App\Framework\LiveComponents\Batch\BatchProcessor;
use App\Framework\LiveComponents\Batch\BatchRequest;
use App\Framework\LiveComponents\ValueObjects\BatchOperation;
use Tests\Feature\Framework\LiveComponents\TestHarness\LiveComponentTestCase;
/**
* E2E Tests for Batch Operations
*
* Tests batch request processing end-to-end.
*/
class BatchOperationsE2ETest extends LiveComponentTestCase
{
private BatchProcessor $batchProcessor;
protected function setUp(): void
{
parent::setUp();
$this->batchProcessor = $this->getContainer()->get(BatchProcessor::class);
}
public function test_processes_multiple_operations_in_batch(): void
{
// Create batch request with multiple operations
$operations = [
BatchOperation::fromArray([
'componentId' => 'counter:test1',
'method' => 'increment',
'params' => ['amount' => 1],
]),
BatchOperation::fromArray([
'componentId' => 'counter:test2',
'method' => 'increment',
'params' => ['amount' => 2],
]),
];
$batchRequest = new BatchRequest(...$operations);
$response = $this->batchProcessor->process($batchRequest);
$this->assertEquals(2, $response->totalOperations);
$this->assertEquals(2, $response->successCount);
$this->assertEquals(0, $response->failureCount);
$this->assertTrue($response->isFullSuccess());
}
public function test_handles_partial_failures_gracefully(): void
{
// Create batch with one valid and one invalid operation
$operations = [
BatchOperation::fromArray([
'componentId' => 'counter:test1',
'method' => 'increment',
'params' => ['amount' => 1],
]),
BatchOperation::fromArray([
'componentId' => 'nonexistent:test',
'method' => 'increment',
'params' => [],
]),
];
$batchRequest = new BatchRequest(...$operations);
$response = $this->batchProcessor->process($batchRequest);
$this->assertEquals(2, $response->totalOperations);
$this->assertEquals(1, $response->successCount);
$this->assertEquals(1, $response->failureCount);
$this->assertTrue($response->hasPartialFailure());
}
public function test_supports_fragments_in_batch_operations(): void
{
$operations = [
BatchOperation::fromArray([
'componentId' => 'counter:test1',
'method' => 'increment',
'params' => ['amount' => 5],
'fragments' => ['counter-display'],
]),
];
$batchRequest = new BatchRequest(...$operations);
$response = $this->batchProcessor->process($batchRequest);
$this->assertEquals(1, $response->successCount);
$result = $response->getSuccessfulResults()[0];
$this->assertTrue($result->hasFragments());
$this->assertArrayHasKey('counter-display', $result->fragments);
}
}

View File

@@ -0,0 +1,56 @@
<?php
declare(strict_types=1);
namespace Tests\Feature\Framework\LiveComponents\E2E;
use Tests\Feature\Framework\LiveComponents\TestHarness\LiveComponentTestCase;
/**
* E2E Tests for Partial Rendering
*
* Tests fragment-based partial updates end-to-end.
*/
class PartialRenderingE2ETest extends LiveComponentTestCase
{
public function test_updates_single_fragment_via_action(): void
{
$this->mount('counter:test', ['count' => 0]);
// Call action with fragment request
$this->call('increment', ['amount' => 5], ['counter-display']);
// Should return fragments instead of full HTML
$html = $this->getHtml();
$this->assertIsArray($html);
$this->assertArrayHasKey('counter-display', $html);
$this->assertStringContainsString('5', $html['counter-display']);
// State should be updated
$this->seeStateKey('count', 5);
}
public function test_updates_multiple_fragments_simultaneously(): void
{
// This would require a component with multiple fragments
$this->markTestSkipped('Requires component with multiple fragments');
}
public function test_falls_back_to_full_render_when_fragments_not_found(): void
{
$this->mount('counter:test', ['count' => 0]);
// Request non-existent fragment
$this->call('increment', ['amount' => 5], ['non-existent-fragment']);
// Should fall back to full HTML
$html = $this->getHtml();
$this->assertIsString($html);
$this->assertStringContainsString('5', $html);
}
}