Skip to content

Instantly share code, notes, and snippets.

@dantleech
Created June 26, 2016 09:14
Show Gist options
  • Select an option

  • Save dantleech/390fb32b310b3a2ea259754911f9340b to your computer and use it in GitHub Desktop.

Select an option

Save dantleech/390fb32b310b3a2ea259754911f9340b to your computer and use it in GitHub Desktop.
<?php
namespace DTL\Bolt\Extension\Fixtures\Tests\Functional;
use Silex\Application;
use DTL\Bolt\Extension\Fixtures\DtlBoltFixturesExtension;
class ApplicationTestCase extends \PHPUnit_Framework_TestCase
{
protected function getApplication()
{
$application = require_once(__DIR__ . '/../../vendor/bolt/bolt/app/bootstrap.php');
$application->initialize();
$application->boot();
$extension = new DtlBoltFixturesExtension($application);
$extension->setContainer($application);
$extension->register($application);
}
protected function getService($serviceId)
{
$application = $this->getApplication();
return $application[$serviceId];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment