Context
ProcessVariablePlaceholderResolver (added in #9, released in 0.5.0) resolves {{ name }} process-variable placeholders in form schemas server-side. It shipped without a test because the bundle has no test infrastructure yet — no autoload-dev, no tests/ directory, no phpunit.dist.xml, no CI workflow (phpunit/phpunit is only present in require-dev).
Setting up test infra for a shared bundle is a separate decision from the feature, so it is tracked here rather than done inline.
Tasks
Drop-in test
tests/Schema/ProcessVariablePlaceholderResolverTest.php
<?php
declare(strict_types=1);
namespace Dmstr\Flowable\Tests\Schema;
use Dmstr\Flowable\Schema\ProcessVariablePlaceholderResolver;
use PHPUnit\Framework\TestCase;
final class ProcessVariablePlaceholderResolverTest extends TestCase
{
public function testSubstitutesBareIdentifierTokens(): void
{
$schema = ['properties' => ['user' => ['x-collection' => '/api/user?rolle=aussendienst_{{ kreisnummer }}']]];
$out = ProcessVariablePlaceholderResolver::resolve($schema, ['kreisnummer' => 115]);
self::assertSame('/api/user?rolle=aussendienst_115', $out['properties']['user']['x-collection']);
}
public function testLeavesDottedJedisonTokensUntouched(): void
{
$schema = ['x-template' => 'fogu-{{ jahr.value }}-{{ revierId.value }}'];
$out = ProcessVariablePlaceholderResolver::resolve($schema, ['jahr' => 2026]);
self::assertSame('fogu-{{ jahr.value }}-{{ revierId.value }}', $out['x-template']);
}
public function testLeavesUnknownIdentifiersUntouched(): void
{
$out = ProcessVariablePlaceholderResolver::resolve(['a' => '{{ missing }}'], ['other' => 'x']);
self::assertSame('{{ missing }}', $out['a']);
}
public function testStringifiesBooleanAndDropsNonScalar(): void
{
$out = ProcessVariablePlaceholderResolver::resolve(
['flag' => '{{ on }}', 'arr' => 'x={{ list }}'],
['on' => true, 'list' => [1, 2]],
);
self::assertSame('true', $out['flag']);
self::assertSame('x=', $out['arr']);
}
public function testEmptyVariableMapReturnsSchemaUnchanged(): void
{
$schema = ['a' => '{{ x }}'];
self::assertSame($schema, ProcessVariablePlaceholderResolver::resolve($schema, []));
}
public function testWalksNestedArraysAndPreservesNonStrings(): void
{
$schema = ['deep' => ['n' => 5, 'url' => 'r_{{ k }}', 'flag' => true]];
$out = ProcessVariablePlaceholderResolver::resolve($schema, ['k' => 'v']);
self::assertSame(['deep' => ['n' => 5, 'url' => 'r_v', 'flag' => true]], $out);
}
}
Context
ProcessVariablePlaceholderResolver(added in #9, released in 0.5.0) resolves{{ name }}process-variable placeholders in form schemas server-side. It shipped without a test because the bundle has no test infrastructure yet — noautoload-dev, notests/directory, nophpunit.dist.xml, no CI workflow (phpunit/phpunitis only present inrequire-dev).Setting up test infra for a shared bundle is a separate decision from the feature, so it is tracked here rather than done inline.
Tasks
autoload-devPSR-4 mappingDmstr\\Flowable\\Tests\\→tests/tocomposer.json.phpunit.dist.xml(PHPUnit ^12, already inrequire-dev).vendor/bin/phpunit(mirrordmstr/openapi-json-schema-bundle's CLI-only Docker Compose /.github/workflows/tests.yml).Drop-in test
tests/Schema/ProcessVariablePlaceholderResolverTest.php