[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)
This commit is contained in:
Alexander 2012-06-18 10:10:57 +02:00
parent 8ff2838bb8
commit 0b0fe74e93
3 changed files with 24 additions and 7 deletions

View File

@ -25,6 +25,10 @@ class BundleTest extends \PHPUnit_Framework_TestCase
$this->markTestSkipped('The "Console" component is not available'); $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')) { if (!class_exists('Symfony\Component\Finder\Finder')) {
$this->markTestSkipped('The "Finder" component is not available'); $this->markTestSkipped('The "Finder" component is not available');
} }

View File

@ -0,0 +1,19 @@
<?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\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
}

View File

@ -12,7 +12,6 @@
namespace Symfony\Component\HttpKernel\Tests; namespace Symfony\Component\HttpKernel\Tests;
use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
@ -724,7 +723,7 @@ EOF;
protected function getBundle($dir = null, $parent = null, $className = null, $bundleName = null) protected function getBundle($dir = null, $parent = null, $className = null, $bundleName = null)
{ {
$bundle = $this $bundle = $this
->getMockBuilder('Symfony\Component\HttpKernel\Tests\BundleForTest') ->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\TestBundle')
->setMethods(array('getPath', 'getParent', 'getName')) ->setMethods(array('getPath', 'getParent', 'getName'))
->disableOriginalConstructor() ->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
}