summaryrefslogtreecommitdiff
path: root/vendor/symfony/http-kernel/Tests/KernelTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/http-kernel/Tests/KernelTest.php')
-rw-r--r--vendor/symfony/http-kernel/Tests/KernelTest.php35
1 files changed, 12 insertions, 23 deletions
diff --git a/vendor/symfony/http-kernel/Tests/KernelTest.php b/vendor/symfony/http-kernel/Tests/KernelTest.php
index f97074e1cd..20e2eb6b7f 100644
--- a/vendor/symfony/http-kernel/Tests/KernelTest.php
+++ b/vendor/symfony/http-kernel/Tests/KernelTest.php
@@ -21,6 +21,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\DependencyInjection\ResettableServicePass;
use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetter;
+use Symfony\Component\HttpKernel\HttpKernel;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\Tests\Fixtures\KernelForOverrideName;
@@ -30,7 +31,7 @@ use Symfony\Component\HttpKernel\Tests\Fixtures\ResettableService;
class KernelTest extends TestCase
{
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
$fs = new Filesystem();
$fs->remove(__DIR__.'/Fixtures/var');
@@ -64,12 +65,10 @@ class KernelTest extends TestCase
$this->assertNull($clone->getContainer());
}
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The environment "test.env" contains invalid characters, it can only contain characters allowed in PHP class names.
- */
public function testClassNameValidityGetter()
{
+ $this->expectException('InvalidArgumentException');
+ $this->expectExceptionMessage('The environment "test.env" contains invalid characters, it can only contain characters allowed in PHP class names.');
// We check the classname that will be generated by using a $env that
// contains invalid characters.
$env = 'test.env';
@@ -348,35 +347,27 @@ EOF;
$this->assertEquals($expected, serialize($kernel));
}
- /**
- * @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())
@@ -464,14 +455,12 @@ EOF;
);
}
- /**
- * @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();