[FrameworkBundle] removed unneeded files in tests
This commit is contained in:
parent
6452878d28
commit
30e907663b
@ -17,8 +17,6 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\RedirectController;
|
||||
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser;
|
||||
use Symfony\Bundle\FrameworkBundle\Tests\Logger;
|
||||
use Symfony\Bundle\FrameworkBundle\Tests\Kernel;
|
||||
|
||||
/**
|
||||
* @author Marcin Sikon<marcin.sikon@gmail.com>
|
||||
|
@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bundle\FrameworkBundle\Tests;
|
||||
|
||||
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
|
||||
use Symfony\Component\HttpKernel\Util\Filesystem;
|
||||
use Symfony\Component\ClassLoader\UniversalClassLoader;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
|
||||
class Kernel extends BaseKernel
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->rootDir = sys_get_temp_dir().'/sf2_'.rand(1, 9999);
|
||||
if (!is_dir($this->rootDir)) {
|
||||
if (false === @mkdir($this->rootDir)) {
|
||||
exit(sprintf('Unable to create a temporary directory (%s)', $this->rootDir));
|
||||
}
|
||||
} elseif (!is_writable($this->rootDir)) {
|
||||
exit(sprintf('Unable to write in a temporary directory (%s)', $this->rootDir));
|
||||
}
|
||||
|
||||
parent::__construct('env', true);
|
||||
|
||||
$loader = new UniversalClassLoader();
|
||||
$loader->registerNamespaces(array(
|
||||
'TestBundle' => __DIR__.'/Fixtures/',
|
||||
'TestApplication' => __DIR__.'/Fixtures/',
|
||||
));
|
||||
$loader->register();
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$fs = new Filesystem();
|
||||
$fs->remove($this->rootDir);
|
||||
}
|
||||
|
||||
public function registerBundles()
|
||||
{
|
||||
return array(
|
||||
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
|
||||
new \TestBundle\Sensio\FooBundle\SensioFooBundle(),
|
||||
new \TestBundle\Sensio\Cms\FooBundle\SensioCmsFooBundle(),
|
||||
new \TestBundle\FooBundle\FooBundle(),
|
||||
new \TestBundle\Fabpot\FooBundle\FabpotFooBundle(),
|
||||
);
|
||||
}
|
||||
|
||||
public function registerContainerConfiguration(LoaderInterface $loader)
|
||||
{
|
||||
$loader->load(function ($container) {
|
||||
$container->setParameter('kernel.compiled_classes', array());
|
||||
});
|
||||
}
|
||||
}
|
@ -1,88 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bundle\FrameworkBundle\Tests;
|
||||
|
||||
use Symfony\Component\HttpKernel\Log\LoggerInterface;
|
||||
|
||||
class Logger implements LoggerInterface
|
||||
{
|
||||
protected $logs;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->clear();
|
||||
}
|
||||
|
||||
public function getLogs($priority = false)
|
||||
{
|
||||
return false === $priority ? $this->logs : $this->logs[$priority];
|
||||
}
|
||||
|
||||
public function clear()
|
||||
{
|
||||
$this->logs = array(
|
||||
'emerg' => array(),
|
||||
'alert' => array(),
|
||||
'crit' => array(),
|
||||
'err' => array(),
|
||||
'warn' => array(),
|
||||
'notice' => array(),
|
||||
'info' => array(),
|
||||
'debug' => array(),
|
||||
);
|
||||
}
|
||||
|
||||
public function log($message, $priority)
|
||||
{
|
||||
$this->logs[$priority][] = $message;
|
||||
}
|
||||
|
||||
public function emerg($message)
|
||||
{
|
||||
$this->log($message, 'emerg');
|
||||
}
|
||||
|
||||
public function alert($message)
|
||||
{
|
||||
$this->log($message, 'alert');
|
||||
}
|
||||
|
||||
public function crit($message)
|
||||
{
|
||||
$this->log($message, 'crit');
|
||||
}
|
||||
|
||||
public function err($message)
|
||||
{
|
||||
$this->log($message, 'err');
|
||||
}
|
||||
|
||||
public function warn($message)
|
||||
{
|
||||
$this->log($message, 'warn');
|
||||
}
|
||||
|
||||
public function notice($message)
|
||||
{
|
||||
$this->log($message, 'notice');
|
||||
}
|
||||
|
||||
public function info($message)
|
||||
{
|
||||
$this->log($message, 'info');
|
||||
}
|
||||
|
||||
public function debug($message)
|
||||
{
|
||||
$this->log($message, 'debug');
|
||||
}
|
||||
}
|
@ -12,7 +12,6 @@
|
||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
|
||||
use Symfony\Bundle\FrameworkBundle\Tests\Kernel;
|
||||
use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference;
|
||||
|
||||
class TemplateTest extends TestCase
|
||||
|
Reference in New Issue
Block a user