-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more tests for WebProfilerBundle
Updated the dev requirements Added more dev dependencies More fixes for tests Try to fix more tests
- Loading branch information
1 parent
ad89564
commit e7dee4b
Showing
3 changed files
with
274 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
src/Symfony/Bundle/WebProfilerBundle/Tests/Functional/WebProfilerBundleKernel.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?php | ||
|
||
namespace Symfony\Bundle\WebProfilerBundle\Tests\Functional; | ||
|
||
use Symfony\Bundle\FrameworkBundle\FrameworkBundle; | ||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; | ||
use Symfony\Bundle\TwigBundle\TwigBundle; | ||
use Symfony\Bundle\WebProfilerBundle\WebProfilerBundle; | ||
use Symfony\Component\Config\Loader\LoaderInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\HttpKernel\Kernel; | ||
use Symfony\Component\Routing\RouteCollectionBuilder; | ||
|
||
class WebProfilerBundleKernel extends Kernel | ||
{ | ||
use MicroKernelTrait; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct('test', false); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getName() | ||
{ | ||
if (null === $this->name) { | ||
$this->name = parent::getName().substr(md5(__CLASS__), -16); | ||
} | ||
|
||
return $this->name; | ||
} | ||
|
||
public function registerBundles() | ||
{ | ||
return [ | ||
new FrameworkBundle(), | ||
new TwigBundle(), | ||
new WebProfilerBundle(), | ||
]; | ||
} | ||
|
||
protected function configureRoutes(RouteCollectionBuilder $routes) | ||
{ | ||
$routes->import(__DIR__.'/../../Resources/config/routing/profiler.xml', '/_profiler'); | ||
$routes->import(__DIR__.'/../../Resources/config/routing/wdt.xml', '/_wdt'); | ||
$routes->add('/', 'kernel:homepageController'); | ||
} | ||
|
||
protected function configureContainer(ContainerBuilder $containerBuilder, LoaderInterface $loader) | ||
{ | ||
$containerBuilder->loadFromExtension('framework', [ | ||
'secret' => 'foo-secret', | ||
'profiler' => ['only_exceptions' => false], | ||
'session' => ['storage_id' => 'session.storage.mock_file'], | ||
]); | ||
|
||
$containerBuilder->loadFromExtension('web_profiler', [ | ||
'toolbar' => true, | ||
'intercept_redirects' => false, | ||
]); | ||
} | ||
|
||
public function getCacheDir() | ||
{ | ||
return sys_get_temp_dir().'/cache-'.spl_object_hash($this); | ||
} | ||
|
||
public function getLogDir() | ||
{ | ||
return sys_get_temp_dir().'/log-'.spl_object_hash($this); | ||
} | ||
|
||
public function homepageController() | ||
{ | ||
return new Response('<html><head></head><body>Homepage Controller.</body></html>'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters