Skip to content

Commit

Permalink
Merge 2e7a57d into 5c44f21
Browse files Browse the repository at this point in the history
  • Loading branch information
svycka committed Feb 27, 2018
2 parents 5c44f21 + 2e7a57d commit 244e29e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Codeception/Module/ZendExpressive.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* ## Config
*
* * container: relative path to file which returns Container (default: `config/container.php`)
* * orm_service: the service name for `Doctrine\ORM\EntityManager` within container (default: `Doctrine\ORM\EntityManager`)
*
* ## API
*
Expand All @@ -32,6 +33,7 @@ class ZendExpressive extends Framework implements DoctrineProvider
{
protected $config = [
'container' => 'config/container.php',
'orm_service' => 'Doctrine\ORM\EntityManager',
];

/**
Expand Down Expand Up @@ -106,11 +108,11 @@ private function initResponseCollector()

public function _getEntityManager()
{
$service = 'Doctrine\ORM\EntityManager';
$service = $this->config['orm_service'];
if (!$this->container->has($service)) {
throw new \PHPUnit_Framework_AssertionFailedError("Service $service is not available in container");
}

return $this->container->get('Doctrine\ORM\EntityManager');
return $this->container->get($service);
}
}

0 comments on commit 244e29e

Please sign in to comment.