0

I'm using ZF 2.5.0 on a legacy application that we are going to write tests for.

I used this question as a reference, but mainly changed many things regarding autoloading.

I'm basically manually instantiating a subclass of AbstractControllerTestCase inside my FeatureContext. I'm specifically trying to get a ServiceLocator instance, so I can load my dependencies (for instance: $locator->get('Doctrine\ORM\EntityManager');).

In order to understand how to bootstrap it, I read the tutorial for PHPUnit. While reading this tutorial, I noticed the Boostrap class creates an instance of a ServiceManager on it's init() class method, but I fail to see how this instance is injected into the application instance that is created by AbstractControllerTestCase.

Any explanation or clarification on this would be appreciated. Or in general about how do I bootstrap an application to work with Behat.

Community
  • 1
  • 1
Christopher Francisco
  • 13,553
  • 23
  • 77
  • 181

1 Answers1

1

I created extension for integration ZF2/3 with Behat. https://github.com/alteris/behat-zendframework-extension

Maybe this help you.

timiTao
  • 1,401
  • 3
  • 19
  • 34