Skip to content

janopae/reproduce-symfony-ux-blocks-cant-be-rendered-in-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reproducer for Symfony UX TwigComponent test helper not being able to render blocks when using {% with … only %}

How to run

composer install
vendor/bin/phpunit

Expected behaviour

The single test in the project passes.

(It might emit warnings/issues.)

Actual behaviour

The single test in the project fails with:

1) App\FunctionalTest::loads_component
Twig\Error\RuntimeError: Variable "blocks" does not exist in "__string_template__d4011b95956114f86c150627f8ecfaab" at line 1.

This is because the block is defined with a limited set of variables in its scope. We can't expect production code to specify a variable only introduced (internally) by a test helper.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published