I tried to setup codeception for my Symfony2 project which already has 4 working bundles and their PHPUnit testcases. Now I wanted to add codeception Testcases, especially for acceptance tests, but when I "bootstrapped" codeception I found all the generated code within my main structure. Since my application is already organized in bundles I wanted to keep the concept as well for my testcases. Especially since I already have my PHPUnit testcases within my bundles. The official s2 codeception does not really cover this. So for me some questions arise:
I just set that up in a similar way.
codeception has a -c switch that will do what you need, i.e.:
vendor/bin/codecept bootstrap src/Acme/ExampleBundle
and then:
vendor/bin/codecept run -c src/Acme/ExampleBundle
I don't know about your 2nd question. At least for Unit tests, converting them to Codeception tests was trivial, especially since my tests all inhert from an abstract class, so it took maybe 10 lines of change there, mostly setup stuff.
@Tom That doesen't work because the Symfony2-Module is looking for the bootstrap.php.cache-file which is still in the root-folder of your symfony2-app! My solution for this is to create a link in your bundle to your app/ folder! than it gonna work!
In {your-root}/src/{your-app}/{your-bundle}:
ln -s ../../../app .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With