Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed all framework extensions to take advantage of the new extensi…
…on configuration inheritance from previous commit
- Loading branch information
Showing
20 changed files
with
486 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/Symfony/Framework/DoctrineBundle/Tests/DependencyInjection/DoctrineExtensionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?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\Framework\DoctrineBundle\Tests\DependencyInjection; | ||
|
||
use Symfony\Framework\DoctrineBundle\Tests\TestCase; | ||
use Symfony\Framework\DoctrineBundle\DependencyInjection\DoctrineExtension; | ||
use Symfony\Components\DependencyInjection\BuilderConfiguration; | ||
|
||
class DoctrineExtensionTest extends TestCase | ||
{ | ||
public function testDbalLoad() | ||
{ | ||
$configuration = new BuilderConfiguration(); | ||
$loader = new DoctrineExtension(array(), array()); | ||
|
||
$configuration = $loader->dbalLoad(array(), $configuration); | ||
$this->assertEquals('Symfony\\Framework\\DoctrineBundle\\DataCollector\\DoctrineDataCollector', $configuration->getParameter('doctrine.data_collector.class'), '->dbalLoad() loads the dbal.xml file if not already loaded'); | ||
|
||
// doctrine.dbal.default_connection | ||
$this->assertEquals('default', $configuration->getParameter('doctrine.dbal.default_connection'), '->dbalLoad() overrides existing configuration options'); | ||
$configuration = $loader->dbalLoad(array('default_connection' => 'foo'), $configuration); | ||
$this->assertEquals('foo', $configuration->getParameter('doctrine.dbal.default_connection'), '->dbalLoad() overrides existing configuration options'); | ||
$configuration = $loader->dbalLoad(array(), $configuration); | ||
$this->assertEquals('foo', $configuration->getParameter('doctrine.dbal.default_connection'), '->dbalLoad() overrides existing configuration options'); | ||
|
||
$configuration = new BuilderConfiguration(); | ||
$loader = new DoctrineExtension(array(), array()); | ||
$configuration = $loader->dbalLoad(array('password' => 'foo'), $configuration); | ||
|
||
$arguments = $configuration->getDefinition('doctrine.dbal.default_connection')->getArguments(); | ||
$config = $arguments[0]; | ||
|
||
$this->assertEquals('foo', $config['password']); | ||
$this->assertEquals('root', $config['user']); | ||
|
||
$configuration = $loader->dbalLoad(array('user' => 'foo'), $configuration); | ||
$this->assertEquals('foo', $config['password']); | ||
$this->assertEquals('root', $config['user']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/Symfony/Framework/ProfilerBundle/Tests/DependencyInjection/ProfilerExtensionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?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\Framework\ProfilerBundle\Tests\DependencyInjection; | ||
|
||
use Symfony\Framework\ProfilerBundle\Tests\TestCase; | ||
use Symfony\Framework\ProfilerBundle\DependencyInjection\ProfilerExtension; | ||
use Symfony\Components\DependencyInjection\BuilderConfiguration; | ||
|
||
class ProfilerExtensionTest extends TestCase | ||
{ | ||
public function testLoggerLoad() | ||
{ | ||
$configuration = new BuilderConfiguration(); | ||
$loader = new ProfilerExtension(); | ||
|
||
$configuration = $loader->configLoad(array(), $configuration); | ||
$this->assertEquals('Symfony\\Framework\\ProfilerBundle\\DataCollector\\DataCollectorManager', $configuration->getParameter('data_collector_manager.class'), '->configLoad() loads the collectors.xml file if not already loaded'); | ||
$this->assertFalse($configuration->hasParameter('debug.toolbar.class'), '->configLoad() does not load the toolbar.xml file'); | ||
|
||
$configuration = $loader->configLoad(array('toolbar' => true), $configuration); | ||
$this->assertEquals('Symfony\\Framework\\ProfilerBundle\\Listener\\WebDebugToolbar', $configuration->getParameter('debug.toolbar.class'), '->configLoad() loads the collectors.xml file if the toolbar option is given'); | ||
} | ||
} |
Oops, something went wrong.