From 0b0fe74e9396312f5e87fd4d305d2f2aba5ec726 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 18 Jun 2012 10:10:57 +0200 Subject: [PATCH] [HttpKernel] Fix component 'standalone' testsuite - Missing dependency in one file - Move helper class out of KernelTest because it implemented an interface that depends on another component (thus would crash the testsuite if invoked) --- .../HttpKernel/Tests/Bundle/BundleTest.php | 4 ++++ .../HttpKernel/Tests/Fixtures/TestBundle.php | 19 +++++++++++++++++++ .../Component/HttpKernel/Tests/KernelTest.php | 8 +------- 3 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 src/Symfony/Component/HttpKernel/Tests/Fixtures/TestBundle.php diff --git a/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php b/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php index 2b8cc79d36..eaff42a1bc 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php @@ -25,6 +25,10 @@ class BundleTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('The "Console" component is not available'); } + if (!class_exists('Symfony\Component\DependencyInjection\ContainerAwareInterface')) { + $this->markTestSkipped('The "DependencyInjection" component is not available'); + } + if (!class_exists('Symfony\Component\Finder\Finder')) { $this->markTestSkipped('The "Finder" component is not available'); } diff --git a/src/Symfony/Component/HttpKernel/Tests/Fixtures/TestBundle.php b/src/Symfony/Component/HttpKernel/Tests/Fixtures/TestBundle.php new file mode 100644 index 0000000000..53aa55f816 --- /dev/null +++ b/src/Symfony/Component/HttpKernel/Tests/Fixtures/TestBundle.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Tests\Fixtures; + +use Symfony\Component\HttpKernel\Bundle\BundleInterface; + +abstract class TestBundle implements BundleInterface +{ + // We can not extend Symfony\Component\HttpKernel\Bundle\Bundle as we want to mock getName() which is final +} diff --git a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php index a26d9d7fc1..578240b9fb 100644 --- a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php @@ -12,7 +12,6 @@ namespace Symfony\Component\HttpKernel\Tests; use Symfony\Component\HttpKernel\Kernel; -use Symfony\Component\HttpKernel\Bundle\BundleInterface; use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpFoundation\Request; @@ -724,7 +723,7 @@ EOF; protected function getBundle($dir = null, $parent = null, $className = null, $bundleName = null) { $bundle = $this - ->getMockBuilder('Symfony\Component\HttpKernel\Tests\BundleForTest') + ->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\TestBundle') ->setMethods(array('getPath', 'getParent', 'getName')) ->disableOriginalConstructor() ; @@ -775,8 +774,3 @@ EOF; ; } } - -abstract class BundleForTest implements BundleInterface -{ - // We can not extend Symfony\Component\HttpKernel\Bundle\Bundle as we want to mock getName() which is final -}