From 65344423c6daa3236f06cab6d83a17beb2ae0954 Mon Sep 17 00:00:00 2001 From: Bulat Shakirzyanov Date: Thu, 2 Sep 2010 15:45:33 -0400 Subject: [PATCH 1/5] [Form] make CollectionField and FieldGroup work nicely together --- .../Component/Form/CollectionField.php | 48 +++++++++++++------ 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/src/Symfony/Component/Form/CollectionField.php b/src/Symfony/Component/Form/CollectionField.php index f982bd64abd7a..e02a8509bac25 100644 --- a/src/Symfony/Component/Form/CollectionField.php +++ b/src/Symfony/Component/Form/CollectionField.php @@ -19,6 +19,8 @@ */ class CollectionField extends FieldGroup { + CONST PLACEHOLDER_KEY = '$$key$$'; + /** * The prototype for the inner fields * @var FieldInterface @@ -40,13 +42,6 @@ public function __construct(FieldInterface $innerField, array $options = array() protected function configure() { $this->addOption('modifiable', false); - - if ($this->getOption('modifiable')) { - $field = $this->newField('$$key$$', null); - // TESTME - $field->setRequired(false); - $this->add($field); - } } public function setData($collection) @@ -55,7 +50,13 @@ public function setData($collection) throw new UnexpectedTypeException('The data must be an array'); } - foreach ($collection as $name => $value) { + foreach ($this as $name => $field) + { + $this->remove($name); + } + + foreach ($collection as $name => $value) + { $this->add($this->newField($name, $name)); } @@ -68,15 +69,25 @@ public function bind($taintedData) $taintedData = array(); } - foreach ($this as $name => $field) { - if (!isset($taintedData[$name]) && $this->getOption('modifiable') && $name != '$$key$$') { - $this->remove($name); + if ($this->getOption('modifiable')) + { + unset($taintedData[self::PLACEHOLDER_KEY]); + parent::setData(null); + + foreach ($this as $name => $field) + { + if (!isset($taintedData[$name])) + { + $this->remove($name); + } } - } - foreach ($taintedData as $name => $value) { - if (!isset($this[$name]) && $this->getOption('modifiable')) { - $this->add($this->newField($name, $name)); + foreach ($taintedData as $name => $value) + { + if (!isset($this[$name])) + { + $this->add($this->newField($name, $name)); + } } } @@ -90,4 +101,11 @@ protected function newField($key, $propertyPath) $field->setPropertyPath($propertyPath === null ? null : '['.$propertyPath.']'); return $field; } + + public function getPlaceholderField() + { + $field = $this->newField(self::PLACEHOLDER_KEY, null); + $field->setParent($this); + return $field; + } } \ No newline at end of file From 54b4a3a4a780e6d61b277538ce6c0df97cf33e22 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Tue, 19 Oct 2010 15:45:04 -0400 Subject: [PATCH 2/5] Fix UniversalClassLoader issues with leading slashes. This fixes a bug in UniversalClassLoader when attempting to autoload class names with leading slashes: $namespacedClass = "\\Foo\\Bar"; $pearlikeClass = "\\Foo_Bar"; $namespaced = new $namespacedClass(); $pearlike = new $pearlikeClass(); `UniversalClassLoader::loadClass()` was unable to load PEAR-like classes with leading slashes because it found the slash and assumed that the requested class was namespaced. It was unable to load namespaced classes with leading slashes because it would look them up in the autoloader's registered namespaces, and was unable to match '\Foo' to 'Foo'. One (ugly) workaround for the namespaced classes was to register all namespaces twice: $loader->registerNamespaces(array( 'Foo' => __DIR__ . '/lib', '\Foo' => __DIR__ . '/lib', )); But that's not very pretty, nor does it solve the bug with PEAR-like classes. Stripping the leading slash before trying to autoload allows UniversalClassLoader to load both namespaced and PEAR-like classes. --- .../HttpFoundation/UniversalClassLoader.php | 4 ++ .../Fixtures/Namespaced/Bar.php | 7 ++++ .../Fixtures/Namespaced/Foo.php | 7 ++++ .../HttpFoundation/Fixtures/Pearlike/Bar.php | 5 +++ .../HttpFoundation/Fixtures/Pearlike/Foo.php | 5 +++ .../UniversalClassLoaderTest.php | 41 +++++++++++++++++++ 6 files changed, 69 insertions(+) create mode 100644 tests/Symfony/Tests/Component/HttpFoundation/Fixtures/Namespaced/Bar.php create mode 100644 tests/Symfony/Tests/Component/HttpFoundation/Fixtures/Namespaced/Foo.php create mode 100644 tests/Symfony/Tests/Component/HttpFoundation/Fixtures/Pearlike/Bar.php create mode 100644 tests/Symfony/Tests/Component/HttpFoundation/Fixtures/Pearlike/Foo.php create mode 100644 tests/Symfony/Tests/Component/HttpFoundation/UniversalClassLoaderTest.php diff --git a/src/Symfony/Component/HttpFoundation/UniversalClassLoader.php b/src/Symfony/Component/HttpFoundation/UniversalClassLoader.php index b651c225f40ca..8382ef578261c 100644 --- a/src/Symfony/Component/HttpFoundation/UniversalClassLoader.php +++ b/src/Symfony/Component/HttpFoundation/UniversalClassLoader.php @@ -123,6 +123,10 @@ public function register() */ public function loadClass($class) { + if ('\\' === $class[0]) { + $class = substr($class, 1); + } + if (false !== ($pos = strripos($class, '\\'))) { // namespaced class name $namespace = substr($class, 0, $pos); diff --git a/tests/Symfony/Tests/Component/HttpFoundation/Fixtures/Namespaced/Bar.php b/tests/Symfony/Tests/Component/HttpFoundation/Fixtures/Namespaced/Bar.php new file mode 100644 index 0000000000000..c16eef7b080cc --- /dev/null +++ b/tests/Symfony/Tests/Component/HttpFoundation/Fixtures/Namespaced/Bar.php @@ -0,0 +1,7 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Tests\Component\HttpFoundation; + +use Symfony\Component\HttpFoundation\UniversalClassLoader; + +class UniversalClassLoaderTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers Symfony\Component\HttpFoundation\UniversalClassLoader::loadClass + * @dataProvider testClassProvider + */ + public function testLoadClass($className, $testClassName, $message) + { + $loader = new UniversalClassLoader(); + $loader->registerNamespace('Namespaced', __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures'); + $loader->registerPrefix('Pearlike_', __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures'); + $loader->loadClass($testClassName); + $this->assertTrue(class_exists($className), $message); + } + + public static function testClassProvider() + { + return array( + array('\\Namespaced\\Foo', 'Namespaced\\Foo', '->loadClass() loads Namespaced\Foo class'), + array('\\Pearlike_Foo', 'Pearlike_Foo', '->loadClass() loads Pearlike_Foo class'), + array('\\Namespaced\\Bar', '\\Namespaced\\Bar', '->loadClass() loads Namespaced\Bar class with a leading slash'), + array('\\Pearlike_Bar', '\\Pearlike_Bar', '->loadClass() loads Pearlike_Bar class with a leading slash'), + ); + } +} + From 75a53cf18c003c489eec1b5e30e8f626ae09ceb3 Mon Sep 17 00:00:00 2001 From: Andy Stanberry Date: Tue, 9 Nov 2010 11:28:14 -0500 Subject: [PATCH 3/5] Allow ValidValidator to walk \Traversable in addition to array --- .../Validator/Constraints/ValidValidator.php | 14 +++++---- .../Constraints/ValidValidatorTest.php | 29 +++++++++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/Validator/Constraints/ValidValidator.php b/src/Symfony/Component/Validator/Constraints/ValidValidator.php index 5ff281f3540b2..9981b5bc3a2f8 100644 --- a/src/Symfony/Component/Validator/Constraints/ValidValidator.php +++ b/src/Symfony/Component/Validator/Constraints/ValidValidator.php @@ -20,21 +20,23 @@ public function isValid($value, Constraint $constraint) $propertyPath = $this->context->getPropertyPath(); $factory = $this->context->getClassMetadataFactory(); - if (is_array($value)) { - foreach ($value as $key => $element) { - $walker->walkConstraint($constraint, $element, $group, $propertyPath.'['.$key.']'); - } - } else if (!is_object($value)) { + if (!is_array($value) && !is_object($value)) { throw new UnexpectedTypeException($value, 'object or array'); } else if ($constraint->class && !$value instanceof $constraint->class) { $this->setMessage($constraint->message, array('class' => $constraint->class)); return false; - } else { + } else if (!is_array($value)) { $metadata = $factory->getClassMetadata(get_class($value)); $walker->walkClass($metadata, $value, $group, $propertyPath); } + if (is_array($value) || $value instanceof \Traversable) { + foreach ($value as $key => $element) { + $walker->walkConstraint($constraint, $element, $group, $propertyPath.'['.$key.']'); + } + } + return true; } } \ No newline at end of file diff --git a/tests/Symfony/Tests/Component/Validator/Constraints/ValidValidatorTest.php b/tests/Symfony/Tests/Component/Validator/Constraints/ValidValidatorTest.php index 788247d6e924d..17e971a6d334b 100644 --- a/tests/Symfony/Tests/Component/Validator/Constraints/ValidValidatorTest.php +++ b/tests/Symfony/Tests/Component/Validator/Constraints/ValidValidatorTest.php @@ -79,6 +79,35 @@ public function testWalkArray() $this->assertTrue($this->validator->isValid($array, $constraint)); } + public function testWalkTraversable() + { + $this->context->setGroup('MyGroup'); + $this->context->setPropertyPath('foo'); + + $constraint = new Valid(); + $metadata = $this->createClassMetadata(); + $entity = new Entity(); + // can only test for one object due to PHPUnit's mocking limitations + $traversable = new \ArrayObject( array('key' => $entity)); + + $this->walker->expects($this->once()) + ->method('walkConstraint') + ->with($this->equalTo($constraint), $this->equalTo($entity), 'MyGroup', 'foo[key]'); + + $this->factory->expects($this->once()) + ->method('getClassMetadata') + ->with($this->equalTo(get_class($traversable))) + ->will($this->returnValue($metadata)); + + + $this->walker->expects($this->once()) + ->method('walkClass') + ->with($this->equalTo($metadata), $this->equalTo($traversable), 'MyGroup', 'foo'); + + + $this->assertTrue($this->validator->isValid($traversable, $constraint)); + } + public function testValidateClass_Succeeds() { $metadata = $this->createClassMetadata(); From 5f5fe4ba9c2b17c4716de21ec80e4799cfc0aadb Mon Sep 17 00:00:00 2001 From: Kris Wallsmith Date: Sat, 30 Oct 2010 12:04:46 -0700 Subject: [PATCH 4/5] [DoctrineMongoDBBundle] fixed profiler menu text --- .../Resources/views/Profiler/mongodb_menu.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Profiler/mongodb_menu.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Profiler/mongodb_menu.php index 346740c9802ef..1e6e3653ee553 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Profiler/mongodb_menu.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Profiler/mongodb_menu.php @@ -1,2 +1,3 @@
getQueryCount() ?>
Mongo +Doctrine MongoDB From aa6dcecb8b444250e90a883b6c20d6063962ba87 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 21 Dec 2010 21:14:33 -0500 Subject: [PATCH 5/5] [DoctrineBundle][DoctrineMongoDBBundle] Allow mappings to be loaded from vendor-organized bundles Bundle best practices advocate organizing a bundle under a vendor namespace (e.g. "Bundle\Vendor\VendorBundle"). That puts the onus on the application developer to explicitly add "Bundle\Vendor" to the kernel's bundle directory configuration. Alternatively, when trying to find a directory for a bundle's namespace we can exhaustively check if parent namespaces are defined in the kernel configuration, which this patch implements. --- .../DependencyInjection/DoctrineExtension.php | 32 ++++++++++++++++--- .../AbstractDoctrineExtensionTest.php | 24 ++++++++++++-- .../AnnotationsBundle/AnnotationsBundle.php | 9 ++++++ .../Vendor/AnnotationsBundle/Entity/Test.php | 7 ++++ .../DoctrineMongoDBExtension.php | 32 ++++++++++++++++--- .../AbstractMongoDBExtensionTest.php | 23 +++++++++++-- .../AnnotationsBundle/AnnotationsBundle.php | 9 ++++++ .../AnnotationsBundle/Document/Test.php | 7 ++++ 8 files changed, 129 insertions(+), 14 deletions(-) create mode 100644 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php create mode 100644 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/Entity/Test.php create mode 100644 src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php create mode 100644 src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/Document/Test.php diff --git a/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php b/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php index 3cf4d8ecb57ab..d9d697b04e8f1 100644 --- a/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php +++ b/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php @@ -328,20 +328,19 @@ protected function loadOrmEntityManagerBundlesMappingInformation(array $entityMa // configure metadata driver for each bundle based on the type of mapping files found $mappingDriverDef = new Definition('%doctrine.orm.metadata.driver_chain_class%'); $bundleEntityMappings = array(); - $bundleDirs = $container->getParameter('kernel.bundle_dirs'); $aliasMap = array(); foreach ($container->getParameter('kernel.bundles') as $className) { $tmp = dirname(str_replace('\\', '/', $className)); $namespace = str_replace('/', '\\', dirname($tmp)); $class = basename($tmp); - if (!isset($bundleDirs[$namespace])) { + if (! $bundleDir = $this->findBundleDirForNamespace($namespace, $container)) { continue; } - $type = $this->detectMetadataDriver($bundleDirs[$namespace].'/'.$class, $container); + $type = $this->detectMetadataDriver($bundleDir.'/'.$class, $container); - if (is_dir($dir = $bundleDirs[$namespace].'/'.$class.'/Entity')) { + if (is_dir($dir = $bundleDir.'/'.$class.'/Entity')) { if ($type === null) { $type = 'annotation'; } @@ -443,6 +442,31 @@ protected function getEntityManagerCacheDefinition(array $entityManager, $cacheD return $cacheDef; } + /** + * Finds the bundle directory for a namespace. + * + * If the namespace does not yield a direct match, this method will attempt + * to match parent namespaces exhaustively. + * + * @param string $namespace A bundle namespace omitting the bundle name part + * @param ContainerBuilder $container A ContainerBuilder instance + * + * @return string|false The bundle directory if found, false otherwise + */ + protected function findBundleDirForNamespace($namespace, ContainerBuilder $container) + { + $bundleDirs = $container->getParameter('kernel.bundle_dirs'); + $segment = $namespace; + + do { + if (isset($bundleDirs[$segment])) { + return $bundleDirs[$segment] . str_replace('\\', '/', substr($namespace, strlen($segment))); + } + } while ($segment = substr($segment, 0, ($pos = strrpos($segment, '\\')))); + + return false; + } + /** * Finds existing bundle subpaths. * diff --git a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php index 99894957c55ce..bc995866b3fbc 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php +++ b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php @@ -385,6 +385,24 @@ public function testAnnotationsBundleMappingDetection() $this->assertEquals('DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\AnnotationsBundle\Entity', $calls[0][1][1]); } + public function testAnnotationsBundleMappingDetectionWithVendorNamespace() + { + $container = $this->getContainer('AnnotationsBundle', 'Vendor'); + $loader = new DoctrineExtension(); + + $loader->dbalLoad(array(), $container); + $loader->ormLoad(array(), $container); + + $this->assertEquals(array(), $container->getParameter('doctrine.orm.metadata_driver.mapping_dirs')); + $this->assertEquals('%doctrine.orm.metadata_driver.mapping_dirs%', $container->getParameter('doctrine.orm.xml_mapping_dirs')); + $this->assertEquals('%doctrine.orm.metadata_driver.mapping_dirs%', $container->getParameter('doctrine.orm.yml_mapping_dirs')); + $this->assertEquals(array(__DIR__.'/Fixtures/Bundles/Vendor/AnnotationsBundle/Entity'), $container->getParameter('doctrine.orm.metadata_driver.entity_dirs')); + + $calls = $container->getDefinition('doctrine.orm.metadata_driver')->getMethodCalls(); + $this->assertEquals('doctrine.orm.metadata_driver.annotation', (string) $calls[0][1][0]); + $this->assertEquals('DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\Vendor\AnnotationsBundle\Entity', $calls[0][1][1]); + } + public function testEntityManagerMetadataCacheDriverConfiguration() { $container = $this->getContainer(); @@ -442,13 +460,13 @@ public function testDependencyInjectionImportsOverrideDefaults() $this->assertTrue($container->getParameter('doctrine.orm.auto_generate_proxy_classes')); } - protected function getContainer($bundle = 'YamlBundle') + protected function getContainer($bundle = 'YamlBundle', $vendor = null) { - require_once __DIR__.'/Fixtures/Bundles/'.$bundle.'/'.$bundle.'.php'; + require_once __DIR__.'/Fixtures/Bundles/'.($vendor ? $vendor.'/' : '').$bundle.'/'.$bundle.'.php'; return new ContainerBuilder(new ParameterBag(array( 'kernel.bundle_dirs' => array('DoctrineBundle\\Tests\\DependencyInjection\\Fixtures\\Bundles' => __DIR__.'/Fixtures/Bundles'), - 'kernel.bundles' => array('DoctrineBundle\\Tests\DependencyInjection\\Fixtures\\Bundles\\'.$bundle.'\\'.$bundle), + 'kernel.bundles' => array('DoctrineBundle\\Tests\DependencyInjection\\Fixtures\\Bundles\\'.($vendor ? $vendor.'\\' : '').$bundle.'\\'.$bundle), 'kernel.cache_dir' => sys_get_temp_dir(), ))); } diff --git a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php new file mode 100644 index 0000000000000..53c3293c58c3d --- /dev/null +++ b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php @@ -0,0 +1,9 @@ +getParameter('kernel.bundle_dirs'); $aliasMap = array(); foreach ($container->getParameter('kernel.bundles') as $className) { $tmp = dirname(str_replace('\\', '/', $className)); $namespace = str_replace('/', '\\', dirname($tmp)); $class = basename($tmp); - if (!isset($bundleDirs[$namespace])) { + if (! $bundleDir = $this->findBundleDirForNamespace($namespace, $container)) { continue; } - $type = $this->detectMetadataDriver($bundleDirs[$namespace].'/'.$class, $container); + $type = $this->detectMetadataDriver($bundleDir.'/'.$class, $container); - if (is_dir($dir = $bundleDirs[$namespace].'/'.$class.'/Document')) { + if (is_dir($dir = $bundleDir.'/'.$class.'/Document')) { if ($type === null) { $type = 'annotation'; } @@ -294,6 +293,31 @@ protected function getConnections(array $config, ContainerBuilder $container) return $connections; } + /** + * Finds the bundle directory for a namespace. + * + * If the namespace does not yield a direct match, this method will attempt + * to match parent namespaces exhaustively. + * + * @param string $namespace A bundle namespace omitting the bundle name part + * @param ContainerBuilder $container A ContainerBuilder instance + * + * @return string|false The bundle directory if found, false otherwise + */ + protected function findBundleDirForNamespace($namespace, ContainerBuilder $container) + { + $bundleDirs = $container->getParameter('kernel.bundle_dirs'); + $segment = $namespace; + + do { + if (isset($bundleDirs[$segment])) { + return $bundleDirs[$segment] . str_replace('\\', '/', substr($namespace, strlen($segment))); + } + } while ($segment = substr($segment, 0, ($pos = strrpos($segment, '\\')))); + + return false; + } + /** * Finds existing bundle subpaths. * diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php index ab6189a7ae472..9860733347672 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php @@ -259,6 +259,23 @@ public function testAnnotationsBundleMappingDetection() $this->assertEquals('DoctrineMongoDBBundle\Tests\DependencyInjection\Fixtures\Bundles\AnnotationsBundle\Document', $calls[0][1][1]); } + public function testAnnotationsBundleMappingDetectionWithVendorNamespace() + { + $container = $this->getContainer('AnnotationsBundle', 'Vendor'); + $loader = new DoctrineMongoDBExtension(); + + $loader->mongodbLoad(array(), $container); + + $this->assertEquals(array(), $container->getParameter('doctrine.odm.mongodb.mapping_dirs')); + $this->assertEquals('%doctrine.odm.mongodb.mapping_dirs%', $container->getParameter('doctrine.odm.mongodb.xml_mapping_dirs')); + $this->assertEquals('%doctrine.odm.mongodb.mapping_dirs%', $container->getParameter('doctrine.odm.mongodb.yml_mapping_dirs')); + $this->assertEquals(array(__DIR__.'/Fixtures/Bundles/Vendor/AnnotationsBundle/Document'), $container->getParameter('doctrine.odm.mongodb.document_dirs')); + + $calls = $container->getDefinition('doctrine.odm.mongodb.metadata')->getMethodCalls(); + $this->assertEquals('doctrine.odm.mongodb.metadata.annotation', (string) $calls[0][1][0]); + $this->assertEquals('DoctrineMongoDBBundle\Tests\DependencyInjection\Fixtures\Bundles\Vendor\AnnotationsBundle\Document', $calls[0][1][1]); + } + public function testDocumentManagerMetadataCacheDriverConfiguration() { $container = $this->getContainer(); @@ -316,13 +333,13 @@ public function testDependencyInjectionImportsOverrideDefaults() $this->assertTrue($container->getParameter('doctrine.odm.mongodb.auto_generate_proxy_classes')); } - protected function getContainer($bundle = 'YamlBundle') + protected function getContainer($bundle = 'YamlBundle', $vendor = null) { - require_once __DIR__.'/Fixtures/Bundles/'.$bundle.'/'.$bundle.'.php'; + require_once __DIR__.'/Fixtures/Bundles/'.($vendor ? $vendor.'/' : '').$bundle.'/'.$bundle.'.php'; return new ContainerBuilder(new ParameterBag(array( 'kernel.bundle_dirs' => array('DoctrineMongoDBBundle\\Tests\\DependencyInjection\\Fixtures\\Bundles' => __DIR__.'/Fixtures/Bundles'), - 'kernel.bundles' => array('DoctrineMongoDBBundle\\Tests\\DependencyInjection\\Fixtures\\Bundles\\'.$bundle.'\\'.$bundle), + 'kernel.bundles' => array('DoctrineMongoDBBundle\\Tests\\DependencyInjection\\Fixtures\\Bundles\\'.($vendor ? $vendor.'\\' : '').$bundle.'\\'.$bundle), 'kernel.cache_dir' => sys_get_temp_dir(), ))); } diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php new file mode 100644 index 0000000000000..c64c8afdc2a69 --- /dev/null +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php @@ -0,0 +1,9 @@ + pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy