mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
N°2435.1 Portal: Split portal composer.json in 2
- Autoloader for portal files in the itop-portal-base module - Dependencies moved to root composer.json - Add autoloader for /core and /application content
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
<?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\DependencyInjection\Compiler;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddCacheWarmerPass;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
*/
|
||||
class AddCacheWarmerPassTest extends TestCase
|
||||
{
|
||||
public function testThatCacheWarmersAreProcessedInPriorityOrder()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
$cacheWarmerDefinition = $container->register('cache_warmer')->addArgument([]);
|
||||
$container->register('my_cache_warmer_service1')->addTag('kernel.cache_warmer', ['priority' => 100]);
|
||||
$container->register('my_cache_warmer_service2')->addTag('kernel.cache_warmer', ['priority' => 200]);
|
||||
$container->register('my_cache_warmer_service3')->addTag('kernel.cache_warmer');
|
||||
|
||||
$addCacheWarmerPass = new AddCacheWarmerPass();
|
||||
$addCacheWarmerPass->process($container);
|
||||
|
||||
$this->assertEquals(
|
||||
[
|
||||
new Reference('my_cache_warmer_service2'),
|
||||
new Reference('my_cache_warmer_service1'),
|
||||
new Reference('my_cache_warmer_service3'),
|
||||
],
|
||||
$cacheWarmerDefinition->getArgument(0)
|
||||
);
|
||||
}
|
||||
|
||||
public function testThatCompilerPassIsIgnoredIfThereIsNoCacheWarmerDefinition()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
|
||||
$addCacheWarmerPass = new AddCacheWarmerPass();
|
||||
$addCacheWarmerPass->process($container);
|
||||
|
||||
// we just check that the pass does not break if no cache warmer is registered
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testThatCacheWarmersMightBeNotDefined()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
$cacheWarmerDefinition = $container->register('cache_warmer')->addArgument([]);
|
||||
|
||||
$addCacheWarmerPass = new AddCacheWarmerPass();
|
||||
$addCacheWarmerPass->process($container);
|
||||
|
||||
$this->assertSame([], $cacheWarmerDefinition->getArgument(0));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user