Skip to content

Commit

Permalink
Doc reproducer + example
Browse files Browse the repository at this point in the history
  • Loading branch information
smnandre committed Dec 21, 2024
1 parent 7ac04b5 commit 339ef20
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
use Symfony\UX\TwigComponent\ComponentFactory;
use Symfony\UX\TwigComponent\ComponentRenderer;

use function Symfony\Component\DependencyInjection\Loader\Configurator\tagged_iterator;

/**
* @author Kevin Bond <[email protected]>
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\UX\LiveComponent\Tests\Unit\DependencyInjection;

use PHPUnit\Framework\TestCase;
Expand All @@ -16,20 +25,20 @@ public function testDefaultSecret()

$this->assertEquals('%kernel.secret%', $config['secret']);
}

public function testEmptySecretThrows()
{
$this->expectException(InvalidConfigurationException::class);
$this->expectExceptionMessage('The path "live_component.secret" cannot contain an empty value, but got null.');

$processor = new Processor();
$config = $processor->processConfiguration(new LiveComponentExtension(), [
'live_component' => [
'secret' => null,
],
]);
}

public function testCustomSecret()
{
$processor = new Processor();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\UX\LiveComponent\Tests\Unit\DependencyInjection;

use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -32,7 +41,7 @@ public function testCustomSecretIsUsedInDefinition(): void
$this->assertSame('custom_secret', $container->getDefinition('ux.live_component.component_hydrator')->getArgument(4));
$this->assertSame('custom_secret', $container->getDefinition('ux.live_component.fingerprint_calculator')->getArgument(0));
}

private function createContainer(): ContainerBuilder
{
$container = new ContainerBuilder(new ParameterBag([
Expand Down

0 comments on commit 339ef20

Please sign in to comment.