Skip to content

Commit

Permalink
[DoctrineBundle] Shortened Dependency Injection Fixture namespace to …
Browse files Browse the repository at this point in the history
…avoid Windows filepath length error.
  • Loading branch information
beberlei authored and fabpot committed Jan 29, 2011
1 parent 6d6c9a5 commit c4a2fb4
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 36 deletions.
Expand Up @@ -18,7 +18,7 @@ public function testAnnotationsBundle()
->with($this->equalTo("Found 1 entities mapped in entity manager 'default':"), $this->equalTo(true));
$output->expects($this->at(1))
->method('write')
->with($this->equalTo("<info>[OK]</info> DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle\Entity\Test"), $this->equalTo(true));
->with($this->equalTo("<info>[OK]</info> Fixtures\Bundles\YamlBundle\Entity\Test"), $this->equalTo(true));

$testContainer = $this->createYamlBundleTestContainer();
$kernel = $this->getMock('Symfony\Component\HttpKernel\Kernel', array(), array(), '', false);
Expand Down
Expand Up @@ -170,7 +170,7 @@ public function testDependencyInjectionConfigurationDefaults()

$definition = $container->getDefinition('doctrine.orm.default_configuration');
$calls = array_values($definition->getMethodCalls());
$this->assertEquals(array('YamlBundle' => 'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle\Entity'), $calls[0][1][0]);
$this->assertEquals(array('YamlBundle' => 'Fixtures\Bundles\YamlBundle\Entity'), $calls[0][1][0]);
$this->assertEquals('doctrine.orm.default_metadata_cache', (string) $calls[1][1][0]);
$this->assertEquals('doctrine.orm.default_query_cache', (string) $calls[2][1][0]);
$this->assertEquals('doctrine.orm.default_result_cache', (string) $calls[3][1][0]);
Expand Down Expand Up @@ -363,7 +363,7 @@ public function testBundleEntityAliases()

$definition = $container->getDefinition('doctrine.orm.default_configuration');
$this->assertDICDefinitionMethodCallOnce($definition, 'setEntityNamespaces',
array(array('YamlBundle' => 'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle\Entity'))
array(array('YamlBundle' => 'Fixtures\Bundles\YamlBundle\Entity'))
);
}

Expand All @@ -377,7 +377,7 @@ public function testOverwriteEntityAliases()

$definition = $container->getDefinition('doctrine.orm.default_configuration');
$this->assertDICDefinitionMethodCallOnce($definition, 'setEntityNamespaces',
array(array('yml' => 'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle\Entity'))
array(array('yml' => 'Fixtures\Bundles\YamlBundle\Entity'))
);
}

Expand All @@ -392,7 +392,7 @@ public function testYamlBundleMappingDetection()
$definition = $container->getDefinition('doctrine.orm.default_metadata_driver');
$this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', array(
new Reference('doctrine.orm.default_yml_metadata_driver'),
'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle\Entity'
'Fixtures\Bundles\YamlBundle\Entity'
));
}

Expand All @@ -407,7 +407,7 @@ public function testXmlBundleMappingDetection()
$definition = $container->getDefinition('doctrine.orm.default_metadata_driver');
$this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', array(
new Reference('doctrine.orm.default_xml_metadata_driver'),
'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\XmlBundle\Entity'
'Fixtures\Bundles\XmlBundle\Entity'
));
}

Expand All @@ -422,7 +422,7 @@ public function testAnnotationsBundleMappingDetection()
$definition = $container->getDefinition('doctrine.orm.default_metadata_driver');
$this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', array(
new Reference('doctrine.orm.default_annotation_metadata_driver'),
'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\AnnotationsBundle\Entity'
'Fixtures\Bundles\AnnotationsBundle\Entity'
));
}

Expand All @@ -444,11 +444,11 @@ public function testOrmMergeConfigs()
$definition = $container->getDefinition('doctrine.orm.default_metadata_driver');
$this->assertDICDefinitionMethodCallAt(0, $definition, 'addDriver', array(
new Reference('doctrine.orm.default_annotation_metadata_driver'),
'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\AnnotationsBundle\Entity'
'Fixtures\Bundles\AnnotationsBundle\Entity'
));
$this->assertDICDefinitionMethodCallAt(1, $definition, 'addDriver', array(
new Reference('doctrine.orm.default_xml_metadata_driver'),
'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\XmlBundle\Entity'
'Fixtures\Bundles\XmlBundle\Entity'
));

$configDef = $container->getDefinition('doctrine.orm.default_configuration');
Expand Down Expand Up @@ -534,17 +534,17 @@ public function testSingleEntityManagerMultipleMappingBundleDefinitions()

$this->assertDICDefinitionMethodCallAt(0, $definition, 'addDriver', array(
new Reference('doctrine.orm.default_annotation_metadata_driver'),
'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\AnnotationsBundle\Entity'
'Fixtures\Bundles\AnnotationsBundle\Entity'
));

$this->assertDICDefinitionMethodCallAt(1, $definition, 'addDriver', array(
new Reference('doctrine.orm.default_yml_metadata_driver'),
'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle\Entity'
'Fixtures\Bundles\YamlBundle\Entity'
));

$this->assertDICDefinitionMethodCallAt(2, $definition, 'addDriver', array(
new Reference('doctrine.orm.default_xml_metadata_driver'),
'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\XmlBundle'
'Fixtures\Bundles\XmlBundle'
));

$annDef = $container->getDefinition('doctrine.orm.default_annotation_metadata_driver');
Expand Down Expand Up @@ -583,17 +583,17 @@ public function testMultipleEntityManagersMappingBundleDefinitions()

$this->assertDICDefinitionMethodCallAt(0, $def1, 'addDriver', array(
new Reference('doctrine.orm.em1_annotation_metadata_driver'),
'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\AnnotationsBundle\Entity'
'Fixtures\Bundles\AnnotationsBundle\Entity'
));

$this->assertDICDefinitionMethodCallAt(0, $def2, 'addDriver', array(
new Reference('doctrine.orm.em2_yml_metadata_driver'),
'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle\Entity'
'Fixtures\Bundles\YamlBundle\Entity'
));

$this->assertDICDefinitionMethodCallAt(1, $def2, 'addDriver', array(
new Reference('doctrine.orm.em2_xml_metadata_driver'),
'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\XmlBundle'
'Fixtures\Bundles\XmlBundle'
));

$annDef = $container->getDefinition('doctrine.orm.em1_annotation_metadata_driver');
Expand Down Expand Up @@ -623,7 +623,7 @@ public function testAnnotationsBundleMappingDetectionWithVendorNamespace()

$calls = $container->getDefinition('doctrine.orm.default_metadata_driver')->getMethodCalls();
$this->assertEquals('doctrine.orm.default_annotation_metadata_driver', (string) $calls[0][1][0]);
$this->assertEquals('DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\Vendor\AnnotationsBundle\Entity', $calls[0][1][1]);
$this->assertEquals('Fixtures\Bundles\Vendor\AnnotationsBundle\Entity', $calls[0][1][1]);
}

public function testSetTypes()
Expand Down Expand Up @@ -653,7 +653,7 @@ protected function getContainer($bundles = 'YamlBundle', $vendor = null)
foreach ($bundles as $bundle) {
require_once __DIR__.'/Fixtures/Bundles/'.($vendor ? $vendor.'/' : '').$bundle.'/'.$bundle.'.php';

$map[$bundle] = 'DoctrineBundle\\Tests\DependencyInjection\\Fixtures\\Bundles\\'.($vendor ? $vendor.'\\' : '').$bundle.'\\'.$bundle;
$map[$bundle] = 'Fixtures\\Bundles\\'.($vendor ? $vendor.'\\' : '').$bundle.'\\'.$bundle;
}

return new ContainerBuilder(new ParameterBag(array(
Expand Down
@@ -1,6 +1,6 @@
<?php

namespace DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\AnnotationsBundle;
namespace Fixtures\Bundles\AnnotationsBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

Expand Down
@@ -1,6 +1,6 @@
<?php

namespace DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\AnnotationsBundle\Entity;
namespace Fixtures\Bundles\AnnotationsBundle\Entity;

class Test
{
Expand Down
@@ -1,6 +1,6 @@
<?php

namespace DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\Vendor\AnnotationsBundle;
namespace Fixtures\Bundles\Vendor\AnnotationsBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

Expand Down
@@ -1,6 +1,6 @@
<?php

namespace DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\Vendor\AnnotationsBundle\Entity;
namespace Fixtures\Bundles\Vendor\AnnotationsBundle\Entity;

class Test
{
Expand Down
@@ -1,6 +1,6 @@
<?php

namespace DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\XmlBundle\Entity;
namespace Fixtures\Bundles\XmlBundle\Entity;

class Test
{
Expand Down
@@ -1,6 +1,6 @@
<?php

namespace DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\XmlBundle;
namespace Fixtures\Bundles\XmlBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

Expand Down
@@ -1,6 +1,6 @@
<?php

namespace DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle\Entity;
namespace Fixtures\Bundles\YamlBundle\Entity;

class Test
{
Expand Down

This file was deleted.

@@ -0,0 +1,5 @@
Fixtures\Bundles\YamlBundle\Entity\Test:
type: entity
id:
id:
type: integer
@@ -1,6 +1,6 @@
<?php

namespace DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle;
namespace Fixtures\Bundles\YamlBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

Expand Down
Expand Up @@ -17,7 +17,7 @@
<doctrine:entity-manager name="em2">
<mappings>
<mapping name="YamlBundle" dir="Resources/config/doctrine/metadata" alias="yml" />
<mapping name="manual" type="xml" prefix="DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\XmlBundle"
<mapping name="manual" type="xml" prefix="Fixtures\Bundles\XmlBundle"
dir="%kernel.root_dir%/../src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine/metadata"
alias="TestAlias"
/>
Expand Down
Expand Up @@ -11,7 +11,7 @@
<mappings>
<mapping name="AnnotationsBundle" />
<mapping name="YamlBundle" dir="Resources/config/doctrine/metadata" alias="yml" />
<mapping name="manual" type="xml" prefix="DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\XmlBundle"
<mapping name="manual" type="xml" prefix="Fixtures\Bundles\XmlBundle"
dir="%kernel.root_dir%/../src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine/metadata"
alias="TestAlias"
/>
Expand Down
Expand Up @@ -10,6 +10,6 @@ doctrine.orm:
alias: yml
manual:
type: xml
prefix: DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\XmlBundle
prefix: Fixtures\Bundles\XmlBundle
dir: %kernel.root_dir%/../src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine/metadata
alias: TestAlias
Expand Up @@ -6,6 +6,6 @@ doctrine.orm:
alias: yml
manual:
type: xml
prefix: DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\XmlBundle
prefix: Fixtures\Bundles\XmlBundle
dir: %kernel.root_dir%/../src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine/metadata
alias: TestAlias
4 changes: 2 additions & 2 deletions src/Symfony/Bundle/DoctrineBundle/Tests/TestCase.php
Expand Up @@ -50,7 +50,7 @@ protected function createTestEntityManager($paths = array())
public function createYamlBundleTestContainer()
{
$container = new ContainerBuilder(new ParameterBag(array(
'kernel.bundles' => array('YamlBundle' => 'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle\YamlBundle'),
'kernel.bundles' => array('YamlBundle' => 'Fixtures\Bundles\YamlBundle\YamlBundle'),
'kernel.cache_dir' => sys_get_temp_dir(),
'kernel.root_dir' => __DIR__ . "/../../../../" // src dir
)));
Expand All @@ -73,7 +73,7 @@ public function createYamlBundleTestContainer()
'mappings' => array('YamlBundle' => array(
'type' => 'yml',
'dir' => __DIR__ . "/DependencyInjection/Fixtures/Bundles/YamlBundle/Resources/config/doctrine/metadata/orm",
'prefix' => 'DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle',
'prefix' => 'Fixtures\Bundles\YamlBundle',
)))), $container);

$container->setDefinition('my.platform', new \Symfony\Component\DependencyInjection\Definition('Doctrine\DBAL\Platforms\MySqlPlatform'));
Expand Down

0 comments on commit c4a2fb4

Please sign in to comment.