Bläddra i källkod

removed the need to define getNamespace() and getPath() in bundles

Fabien Potencier 14 år sedan
förälder
incheckning
e5403490e7
30 ändrade filer med 58 tillägg och 409 borttagningar
  1. 0 15
      src/Symfony/Bundle/CompatAssetsBundle/CompatAssetsBundle.php
  2. 0 16
      src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php
  3. 1 16
      src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php
  4. 1 16
      src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php
  5. 0 15
      src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php
  6. 0 15
      src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php
  7. 0 15
      src/Symfony/Bundle/DoctrineMigrationsBundle/DoctrineMigrationsBundle.php
  8. 0 16
      src/Symfony/Bundle/DoctrineMongoDBBundle/DoctrineMongoDBBundle.php
  9. 0 15
      src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php
  10. 0 15
      src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php
  11. 0 15
      src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php
  12. 1 1
      src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplatePathsCacheWarmer.php
  13. 0 16
      src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php
  14. 0 15
      src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/bundle/Bundle.php
  15. 0 16
      src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Fabpot/FooBundle/FabpotFooBundle.php
  16. 0 15
      src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/FooBundle.php
  17. 0 15
      src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/Cms/FooBundle/SensioCmsFooBundle.php
  18. 0 15
      src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/FooBundle/SensioFooBundle.php
  19. 0 16
      src/Symfony/Bundle/SecurityBundle/SecurityBundle.php
  20. 0 15
      src/Symfony/Bundle/SwiftmailerBundle/SwiftmailerBundle.php
  21. 0 16
      src/Symfony/Bundle/TwigBundle/TwigBundle.php
  22. 0 15
      src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php
  23. 0 16
      src/Symfony/Bundle/ZendBundle/ZendBundle.php
  24. 31 14
      src/Symfony/Component/HttpKernel/Bundle/Bundle.php
  25. 1 9
      src/Symfony/Component/HttpKernel/Bundle/BundleInterface.php
  26. 1 1
      src/Symfony/Component/HttpKernel/Kernel.php
  27. 19 9
      src/Symfony/Component/HttpKernel/bootstrap.php
  28. 1 1
      src/Symfony/Component/HttpKernel/bootstrap_cache.php
  29. 0 33
      tests/Symfony/Tests/Component/HttpKernel/Bundle/BundleTest.php
  30. 2 2
      tests/Symfony/Tests/Component/HttpKernel/KernelTest.php

+ 0 - 15
src/Symfony/Bundle/CompatAssetsBundle/CompatAssetsBundle.php

@@ -20,19 +20,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
  */
 class CompatAssetsBundle extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 16
src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php

@@ -31,20 +31,4 @@ class DoctrineBundle extends Bundle
 
         $container->addCompilerPass(new RegisterEventListenersAndSubscribersPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION);
     }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 1 - 16
src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php

@@ -6,19 +6,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
 
 class AnnotationsBundle extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
-}
+}

+ 1 - 16
src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php

@@ -6,19 +6,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
 
 class AnnotationsBundle extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
-}
+}

+ 0 - 15
src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php

@@ -6,19 +6,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
 
 class XmlBundle extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 15
src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php

@@ -6,19 +6,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
 
 class YamlBundle extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 15
src/Symfony/Bundle/DoctrineMigrationsBundle/DoctrineMigrationsBundle.php

@@ -21,19 +21,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
  */
 class DoctrineMigrationsBundle extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 16
src/Symfony/Bundle/DoctrineMongoDBBundle/DoctrineMongoDBBundle.php

@@ -35,20 +35,4 @@ class DoctrineMongoDBBundle extends Bundle
         $container->addCompilerPass(new CreateProxyDirectoryPass(), PassConfig::TYPE_BEFORE_REMOVING);
         $container->addCompilerPass(new CreateHydratorDirectoryPass(), PassConfig::TYPE_BEFORE_REMOVING);
     }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 15
src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php

@@ -6,19 +6,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
 
 class AnnotationsBundle extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 15
src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php

@@ -6,19 +6,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
 
 class XmlBundle extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 15
src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php

@@ -6,19 +6,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
 
 class YamlBundle extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplatePathsCacheWarmer.php

@@ -64,7 +64,7 @@ class TemplatePathsCacheWarmer extends CacheWarmer
         $prefix = '/Resources/views';
         $templates = array();
         foreach ($this->kernel->getBundles() as $name => $bundle) {
-            if (!is_dir($dir = $bundle->getNormalizedPath().$prefix)) {
+            if (!is_dir($dir = $bundle->getPath().$prefix)) {
                 continue;
             }
 

+ 0 - 16
src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

@@ -80,20 +80,4 @@ class FrameworkBundle extends Bundle
         $container->addCompilerPass(new TranslatorPass());
         $container->addCompilerPass(new AddCacheWarmerPass());
     }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 15
src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/bundle/Bundle.php

@@ -6,19 +6,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
 
 class {{ bundle }} extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return strtr(__DIR__, '\\', '/');
-    }
 }

+ 0 - 16
src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Fabpot/FooBundle/FabpotFooBundle.php

@@ -27,20 +27,4 @@ class FabpotFooBundle extends Bundle
     {
         return 'SensioFooBundle';
     }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 15
src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/FooBundle/FooBundle.php

@@ -20,19 +20,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
  */
 class FooBundle extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 15
src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/Cms/FooBundle/SensioCmsFooBundle.php

@@ -20,19 +20,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
  */
 class SensioCmsFooBundle extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 15
src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TestBundle/Sensio/FooBundle/SensioFooBundle.php

@@ -20,19 +20,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
  */
 class SensioFooBundle extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 16
src/Symfony/Bundle/SecurityBundle/SecurityBundle.php

@@ -30,20 +30,4 @@ class SecurityBundle extends Bundle
         $container->addCompilerPass(new AddSecurityVotersPass());
         $container->addCompilerPass(new AddAuthenticationProvidersPass());
     }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 15
src/Symfony/Bundle/SwiftmailerBundle/SwiftmailerBundle.php

@@ -20,19 +20,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
  */
 class SwiftmailerBundle extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 16
src/Symfony/Bundle/TwigBundle/TwigBundle.php

@@ -28,20 +28,4 @@ class TwigBundle extends Bundle
 
         $container->addCompilerPass(new TwigEnvironmentPass());
     }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 15
src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php

@@ -20,19 +20,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
  */
 class WebProfilerBundle extends Bundle
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 0 - 16
src/Symfony/Bundle/ZendBundle/ZendBundle.php

@@ -28,20 +28,4 @@ class ZendBundle extends Bundle
 
         $container->addCompilerPass(new ZendLoggerWriterPass());
     }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getNamespace()
-    {
-        return __NAMESPACE__;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPath()
-    {
-        return __DIR__;
-    }
 }

+ 31 - 14
src/Symfony/Component/HttpKernel/Bundle/Bundle.php

@@ -25,6 +25,7 @@ use Symfony\Component\Finder\Finder;
 abstract class Bundle extends ContainerAware implements BundleInterface
 {
     protected $name;
+    protected $reflected;
 
     /**
      * Boots the Bundle.
@@ -40,6 +41,34 @@ abstract class Bundle extends ContainerAware implements BundleInterface
     {
     }
 
+    /**
+     * Gets the Bundle namespace.
+     *
+     * @return string The Bundle namespace
+     */
+    public function getNamespace()
+    {
+        if (null === $this->reflected) {
+            $this->reflected = new \ReflectionObject($this);
+        }
+
+        return $this->reflected->getNamespaceName();
+    }
+
+    /**
+     * Gets the Bundle directory path.
+     *
+     * @return string The Bundle absolute path
+     */
+    public function getPath()
+    {
+        if (null === $this->reflected) {
+            $this->reflected = new \ReflectionObject($this);
+        }
+
+        return strtr(dirname($this->reflected->getFileName()), '\\', '/');
+    }
+
     /**
      * Returns the bundle parent name.
      *
@@ -67,18 +96,6 @@ abstract class Bundle extends ContainerAware implements BundleInterface
         return $this->name = false === $pos ? $name :  substr($name, $pos + 1);
     }
 
-    /**
-     * Gets the Bundle directory path.
-     *
-     * The path should always be returned as a Unix path (with /).
-     *
-     * @return string The Bundle absolute path
-     */
-    final public function getNormalizedPath()
-    {
-        return strtr($this->getPath(), '\\', '/');
-    }
-
     /**
      * Finds and registers Dependency Injection Container extensions.
      *
@@ -91,7 +108,7 @@ abstract class Bundle extends ContainerAware implements BundleInterface
      */
     public function registerExtensions(ContainerBuilder $container)
     {
-        if (!$dir = realpath($this->getNormalizedPath().'/DependencyInjection')) {
+        if (!$dir = realpath($this->getPath().'/DependencyInjection')) {
             return;
         }
 
@@ -118,7 +135,7 @@ abstract class Bundle extends ContainerAware implements BundleInterface
      */
     public function registerCommands(Application $application)
     {
-        if (!$dir = realpath($this->getNormalizedPath().'/Command')) {
+        if (!$dir = realpath($this->getPath().'/Command')) {
             return;
         }
 

+ 1 - 9
src/Symfony/Component/HttpKernel/Bundle/BundleInterface.php

@@ -49,14 +49,6 @@ interface BundleInterface
      */
     function getNamespace();
 
-
-    /**
-     * Gets the Bundle directory path.
-     *
-     * @return string The Bundle absolute path
-     */
-    function getPath();
-
     /**
      * Gets the Bundle directory path.
      *
@@ -64,5 +56,5 @@ interface BundleInterface
      *
      * @return string The Bundle absolute path
      */
-    function getNormalizedPath();
+    function getPath();
 }

+ 1 - 1
src/Symfony/Component/HttpKernel/Kernel.php

@@ -237,7 +237,7 @@ abstract class Kernel implements KernelInterface
         }
 
         foreach ($this->getBundle($bundle, false) as $bundle) {
-            if (file_exists($file = $bundle->getNormalizedPath().'/'.$path)) {
+            if (file_exists($file = $bundle->getPath().'/'.$path)) {
                 if ($first) {
                     return $file;
                 }

+ 19 - 9
src/Symfony/Component/HttpKernel/bootstrap.php

@@ -113,7 +113,7 @@ class Container implements ContainerInterface
         $ids = array();
         $r = new \ReflectionClass($this);
         foreach ($r->getMethods() as $method) {
-            if (preg_match('/^get(.+)Service$/', $name = $method->getName(), $match)) {
+            if (preg_match('/^get(.+)Service$/', $method->getName(), $match)) {
                 $ids[] = self::underscore($match[1]);
             }
         }
@@ -229,7 +229,6 @@ interface BundleInterface
     function getName();
     function getNamespace();
     function getPath();
-    function getNormalizedPath();
 }
 }
 namespace Symfony\Component\HttpKernel\Bundle
@@ -241,12 +240,27 @@ use Symfony\Component\Finder\Finder;
 abstract class Bundle extends ContainerAware implements BundleInterface
 {
     protected $name;
+    protected $reflected;
     public function boot()
     {
     }
     public function shutdown()
     {
     }
+    public function getNamespace()
+    {
+        if (null === $this->reflected) {
+            $this->reflected = new \ReflectionObject($this);
+        }
+        return $this->reflected->getNamespaceName();
+    }
+    public function getPath()
+    {
+        if (null === $this->reflected) {
+            $this->reflected = new \ReflectionObject($this);
+        }
+        return strtr(dirname($this->reflected->getFileName()), '\\', '/');
+    }
     public function getParent()
     {
         return null;
@@ -260,13 +274,9 @@ abstract class Bundle extends ContainerAware implements BundleInterface
         $pos = strrpos($name, '\\');
         return $this->name = false === $pos ? $name :  substr($name, $pos + 1);
     }
-    final public function getNormalizedPath()
-    {
-        return strtr($this->getPath(), '\\', '/');
-    }
     public function registerExtensions(ContainerBuilder $container)
     {
-        if (!$dir = realpath($this->getNormalizedPath().'/DependencyInjection')) {
+        if (!$dir = realpath($this->getPath().'/DependencyInjection')) {
             return;
         }
         $finder = new Finder();
@@ -279,7 +289,7 @@ abstract class Bundle extends ContainerAware implements BundleInterface
     }
     public function registerCommands(Application $application)
     {
-        if (!$dir = realpath($this->getNormalizedPath().'/Command')) {
+        if (!$dir = realpath($this->getPath().'/Command')) {
             return;
         }
         $finder = new Finder();
@@ -577,7 +587,7 @@ abstract class Kernel implements KernelInterface
             $files[] = $file;
         }
         foreach ($this->getBundle($bundle, false) as $bundle) {
-            if (file_exists($file = $bundle->getNormalizedPath().'/'.$path)) {
+            if (file_exists($file = $bundle->getPath().'/'.$path)) {
                 if ($first) {
                     return $file;
                 }

+ 1 - 1
src/Symfony/Component/HttpKernel/bootstrap_cache.php

@@ -151,7 +151,7 @@ abstract class Kernel implements KernelInterface
             $files[] = $file;
         }
         foreach ($this->getBundle($bundle, false) as $bundle) {
-            if (file_exists($file = $bundle->getNormalizedPath().'/'.$path)) {
+            if (file_exists($file = $bundle->getPath().'/'.$path)) {
                 if ($first) {
                     return $file;
                 }

+ 0 - 33
tests/Symfony/Tests/Component/HttpKernel/Bundle/BundleTest.php

@@ -1,33 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Tests\Component\HttpKernel\Bundle;
-
-class BundleTest extends \PHPUnit_Framework_TestCase
-{
-    public function testGetNormalizedPathReturnsANormalizedPath()
-    {
-        $bundle = $this
-            ->getMockBuilder('Symfony\Component\HttpKernel\Bundle\Bundle')
-            ->setMethods(array('getPath'))
-            ->disableOriginalConstructor()
-            ->getMockForAbstractClass()
-        ;
-
-        $bundle
-            ->expects($this->once())
-            ->method('getPath')
-            ->will($this->returnValue('path\\to\\foo\\bar'))
-        ;
-
-        $this->assertEquals('path/to/foo/bar', $bundle->getNormalizedPath());
-    }
-}

+ 2 - 2
tests/Symfony/Tests/Component/HttpKernel/KernelTest.php

@@ -255,7 +255,7 @@ class KernelTest extends \PHPUnit_Framework_TestCase
     {
         $bundle = $this
             ->getMockBuilder('Symfony\Tests\Component\HttpKernel\BundleForTest')
-            ->setMethods(array('getNormalizedPath', 'getParent', 'getName'))
+            ->setMethods(array('getPath', 'getParent', 'getName'))
             ->disableOriginalConstructor()
         ;
 
@@ -273,7 +273,7 @@ class KernelTest extends \PHPUnit_Framework_TestCase
 
         $bundle
             ->expects($this->any())
-            ->method('getNormalizedPath')
+            ->method('getPath')
             ->will($this->returnValue(strtr($dir, '\\', '/')))
         ;