init without trunk
This commit is contained in:
parent
ed24ac4994
commit
bb809e7233
14652 changed files with 177862 additions and 94817 deletions
39
vendor/symfony/monolog-bundle/Tests/DependencyInjection/Compiler/FixEmptyLoggerPassTest.php
vendored
Normal file
39
vendor/symfony/monolog-bundle/Tests/DependencyInjection/Compiler/FixEmptyLoggerPassTest.php
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?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\MonologBundle\Tests\DependencyInjection\Compiler;
|
||||
|
||||
use Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\FixEmptyLoggerPass;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
||||
class FixEmptyLoggerPassTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testProcess()
|
||||
{
|
||||
$loggerChannelPass = $this->getMockBuilder('Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\LoggerChannelPass')->getMock();
|
||||
$loggerChannelPass->expects($this->any())->method('getChannels')->will($this->returnValue(array('foo', 'bar')));
|
||||
|
||||
$container = new ContainerBuilder();
|
||||
$container->register('monolog.logger.foo', 'Monolog\Logger');
|
||||
$container->register('monolog.logger.bar', 'Monolog\Logger')->addMethodCall('pushHandler');
|
||||
|
||||
$pass = new FixEmptyLoggerPass($loggerChannelPass);
|
||||
$pass->process($container);
|
||||
|
||||
$calls = $container->getDefinition('monolog.logger.foo')->getMethodCalls();
|
||||
$this->assertCount(1, $calls);
|
||||
$this->assertSame('pushHandler', $calls[0][0]);
|
||||
$this->assertSame('monolog.handler.null_internal', (string) $calls[0][1][0]);
|
||||
|
||||
$calls = $container->getDefinition('monolog.logger.bar')->getMethodCalls();
|
||||
$this->assertCount(1, $calls);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue