Reputation: 31
Using Codeception with Symfony2. Calling grabServiceFromContainer('doctrine') from a functional TestGuy returns a very empty Codeception\Maybe object, not the expected service.
How do you get access to Symfony services from the functional test? Is it not possible? You can from the unit TestGuy - why not from the functional TestGuy? Do I have to fetch the module first?
Upvotes: 3
Views: 994
Reputation: 2873
It works for me with this functional.suite.yml config:
class_name: TestGuy
modules:
enabled: [Symfony2, Doctrine2, TestHelper]
config:
Symfony2:
app_path: 'app'
environment: 'test'
make sure you run the "build" command after changing the config, maybe that is the problem?
Upvotes: 2