AtoumBundle icon indicating copy to clipboard operation
AtoumBundle copied to clipboard

Problem with Symfony 3.0 directory structure

Open marmotz opened this issue 10 years ago • 4 comments

For my new project, I use Symfony 2.5 and I choose the new directory structure (http://stackoverflow.com/questions/23993295/what-is-the-new-symfony-3-directory-structure#23994473)

Unfortunatly, when I launch AtoumBundle tests, app/cache and app/config was created.

marmotz avatar Jul 17 '14 12:07 marmotz

Thx for this issue.

Can you be more specific on the expected behaviour with Symfony 3 and its new directory structure ?

Looking through it, I guess files currently in app/cache should now be located in var/cache. But I didn't find anything related to app/config.

I could obviously look into it, but any help would be greatly appreciated.

geraldcroes avatar Jul 17 '14 13:07 geraldcroes

Sorry, app/config is always in app :)

It's just app/cache -> var/cache (and maybe app/log -> var/log but I can't test for now, maybe tonight)

marmotz avatar Jul 17 '14 13:07 marmotz

Same problem here, I use Symfony 3.0 directory structure, so the Cache directory (%kernel.cache_dir%) is var/cache by default.

When Atoum runs, it build the cache in app/cache instead. I don't know from where it gets this wrong path, it should use the same Kernel the Symfony app use.

Is there any way to override this path in Atoum? Does someone knows where this path is calculated?

Tom32i avatar Aug 05 '15 11:08 Tom32i

All right, I found a solution: you have to tell Atoum to work with var/bootstrap.php.cache instead of app/autoload.php. Fortunately there is an option doing just that in the Atoum command line:

bin/console atoum --bootstrap-file=var/bootstrap.php.cache --env=test

Then the Kernel instance in Atoum will behave exactly as the ones in your app_test.php.

Tom32i avatar Aug 05 '15 12:08 Tom32i