mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-27 04:28:44 +02:00
Updating Symfony lib and dependencies:
Package operations: 2 installs, 23 updates, 0 removals - Updating psr/log (1.1.0 => 1.1.2) - Updating symfony/debug (v3.4.30 => v3.4.35) - Updating symfony/console (v3.4.30 => v3.4.35) - Updating symfony/dotenv (v3.4.30 => v3.4.35) - Updating symfony/routing (v3.4.30 => v3.4.35) - Updating symfony/finder (v3.4.30 => v3.4.35) - Updating symfony/filesystem (v3.4.30 => v3.4.35) - Installing symfony/polyfill-util (v1.12.0) - Installing symfony/polyfill-php56 (v1.12.0) - Updating symfony/http-foundation (v3.4.30 => v3.4.35) - Updating symfony/event-dispatcher (v3.4.30 => v3.4.35) - Updating symfony/http-kernel (v3.4.30 => v3.4.35) - Updating symfony/config (v3.4.30 => v3.4.35) - Updating symfony/dependency-injection (v3.4.30 => v3.4.35) - Updating symfony/class-loader (v3.4.30 => v3.4.35) - Updating symfony/cache (v3.4.30 => v3.4.35) - Updating symfony/framework-bundle (v3.4.30 => v3.4.35) - Updating twig/twig (v1.42.2 => v1.42.4) - Updating symfony/twig-bridge (v3.4.30 => v3.4.35) - Updating symfony/twig-bundle (v3.4.30 => v3.4.35) - Updating symfony/yaml (v3.4.30 => v3.4.35) - Updating symfony/stopwatch (v3.4.30 => v3.4.35) - Updating symfony/var-dumper (v3.4.30 => v3.4.35) - Updating symfony/web-profiler-bundle (v3.4.30 => v3.4.35) - Updating symfony/css-selector (v3.4.30 => v3.4.35)
This commit is contained in:
@@ -118,7 +118,7 @@ class KernelTest extends TestCase
|
||||
public function testBootSetsTheBootedFlagToTrue()
|
||||
{
|
||||
// use test kernel to access isBooted()
|
||||
$kernel = $this->getKernelForTest(['initializeBundles', 'initializeContainer']);
|
||||
$kernel = $this->getKernel(['initializeBundles', 'initializeContainer']);
|
||||
$kernel->boot();
|
||||
|
||||
$this->assertTrue($kernel->isBooted());
|
||||
@@ -388,35 +388,27 @@ EOF;
|
||||
$this->assertEquals($expected, $kernel->serialize());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testLocateResourceThrowsExceptionWhenNameIsNotValid()
|
||||
{
|
||||
$this->expectException('InvalidArgumentException');
|
||||
$this->getKernel()->locateResource('Foo');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
*/
|
||||
public function testLocateResourceThrowsExceptionWhenNameIsUnsafe()
|
||||
{
|
||||
$this->expectException('RuntimeException');
|
||||
$this->getKernel()->locateResource('@FooBundle/../bar');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testLocateResourceThrowsExceptionWhenBundleDoesNotExist()
|
||||
{
|
||||
$this->expectException('InvalidArgumentException');
|
||||
$this->getKernel()->locateResource('@FooBundle/config/routing.xml');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testLocateResourceThrowsExceptionWhenResourceDoesNotExist()
|
||||
{
|
||||
$this->expectException('InvalidArgumentException');
|
||||
$kernel = $this->getKernel(['getBundle']);
|
||||
$kernel
|
||||
->expects($this->once())
|
||||
@@ -672,11 +664,11 @@ EOF;
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @expectedException \LogicException
|
||||
* @expectedExceptionMessage Bundle "ChildCBundle" extends bundle "FooBar", which is not registered.
|
||||
*/
|
||||
public function testInitializeBundlesThrowsExceptionWhenAParentDoesNotExists()
|
||||
{
|
||||
$this->expectException('LogicException');
|
||||
$this->expectExceptionMessage('Bundle "ChildCBundle" extends bundle "FooBar", which is not registered.');
|
||||
$child = $this->getBundle(null, 'FooBar', 'ChildCBundle');
|
||||
$kernel = $this->getKernel([], [$child]);
|
||||
$kernel->boot();
|
||||
@@ -708,11 +700,11 @@ EOF;
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @expectedException \LogicException
|
||||
* @expectedExceptionMessage Bundle "ParentCBundle" is directly extended by two bundles "ChildC2Bundle" and "ChildC1Bundle".
|
||||
*/
|
||||
public function testInitializeBundlesThrowsExceptionWhenABundleIsDirectlyExtendedByTwoBundles()
|
||||
{
|
||||
$this->expectException('LogicException');
|
||||
$this->expectExceptionMessage('Bundle "ParentCBundle" is directly extended by two bundles "ChildC2Bundle" and "ChildC1Bundle".');
|
||||
$parent = $this->getBundle(null, null, 'ParentCBundle');
|
||||
$child1 = $this->getBundle(null, 'ParentCBundle', 'ChildC1Bundle');
|
||||
$child2 = $this->getBundle(null, 'ParentCBundle', 'ChildC2Bundle');
|
||||
@@ -723,13 +715,13 @@ EOF;
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @expectedException \LogicException
|
||||
* @expectedExceptionMessage Trying to register two bundles with the same name "DuplicateName"
|
||||
*/
|
||||
public function testInitializeBundleThrowsExceptionWhenRegisteringTwoBundlesWithTheSameName()
|
||||
{
|
||||
$fooBundle = $this->getBundle(null, null, 'FooBundle', 'DuplicateName');
|
||||
$barBundle = $this->getBundle(null, null, 'BarBundle', 'DuplicateName');
|
||||
$this->expectException('LogicException');
|
||||
$this->expectExceptionMessage('Trying to register two bundles with the same name "DuplicateName"');
|
||||
$fooBundle = $this->getBundle(__DIR__.'/Fixtures/FooBundle', null, 'FooBundle', 'DuplicateName');
|
||||
$barBundle = $this->getBundle(__DIR__.'/Fixtures/BarBundle', null, 'BarBundle', 'DuplicateName');
|
||||
|
||||
$kernel = $this->getKernel([], [$fooBundle, $barBundle]);
|
||||
$kernel->boot();
|
||||
@@ -737,11 +729,11 @@ EOF;
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @expectedException \LogicException
|
||||
* @expectedExceptionMessage Bundle "CircularRefBundle" can not extend itself.
|
||||
*/
|
||||
public function testInitializeBundleThrowsExceptionWhenABundleExtendsItself()
|
||||
{
|
||||
$this->expectException('LogicException');
|
||||
$this->expectExceptionMessage('Bundle "CircularRefBundle" can not extend itself.');
|
||||
$circularRef = $this->getBundle(null, 'CircularRefBundle', 'CircularRefBundle');
|
||||
|
||||
$kernel = $this->getKernel([], [$circularRef]);
|
||||
@@ -906,7 +898,7 @@ EOF;
|
||||
*/
|
||||
public function testKernelStartTimeIsResetWhileBootingAlreadyBootedKernel()
|
||||
{
|
||||
$kernel = $this->getKernelForTest(['initializeBundles'], true);
|
||||
$kernel = $this->getKernel(['initializeBundles'], [], true);
|
||||
$kernel->boot();
|
||||
$preReBoot = $kernel->getStartTime();
|
||||
|
||||
@@ -964,15 +956,15 @@ EOF;
|
||||
*
|
||||
* @return Kernel
|
||||
*/
|
||||
protected function getKernel(array $methods = [], array $bundles = [])
|
||||
protected function getKernel(array $methods = [], array $bundles = [], $debug = false)
|
||||
{
|
||||
$methods[] = 'registerBundles';
|
||||
|
||||
$kernel = $this
|
||||
->getMockBuilder('Symfony\Component\HttpKernel\Kernel')
|
||||
->getMockBuilder(KernelForTest::class)
|
||||
->setMethods($methods)
|
||||
->setConstructorArgs(['test', false])
|
||||
->getMockForAbstractClass()
|
||||
->setConstructorArgs(['test', $debug])
|
||||
->getMock()
|
||||
;
|
||||
$kernel->expects($this->any())
|
||||
->method('registerBundles')
|
||||
@@ -987,10 +979,11 @@ EOF;
|
||||
|
||||
protected function getKernelForTest(array $methods = [], $debug = false)
|
||||
{
|
||||
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
|
||||
$kernel = $this->getMockBuilder(KernelForTest::class)
|
||||
->setConstructorArgs(['test', $debug])
|
||||
->setMethods($methods)
|
||||
->getMock();
|
||||
->getMock()
|
||||
;
|
||||
$p = new \ReflectionProperty($kernel, 'rootDir');
|
||||
$p->setAccessible(true);
|
||||
$p->setValue($kernel, __DIR__.'/Fixtures');
|
||||
@@ -1011,6 +1004,11 @@ class TestKernel implements HttpKernelInterface
|
||||
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true)
|
||||
{
|
||||
}
|
||||
|
||||
public function getProjectDir()
|
||||
{
|
||||
return __DIR__.'/Fixtures';
|
||||
}
|
||||
}
|
||||
|
||||
class CustomProjectDirKernel extends Kernel
|
||||
|
||||
Reference in New Issue
Block a user