Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[2.6] Marked the ResolveParameterPlaceHoldersPassTest as legacy #13941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\DependencyInjection\Tests\Compiler;

use Symfony\Component\DependencyInjection\Compiler\ResolveParameterPlaceHoldersPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;

/**
* @group legacy
*/
class LegacyResolveParameterPlaceHoldersPassTest extends \PHPUnit_Framework_TestCase
{
public function testFactoryClassParametersShouldBeResolved()
{
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);

$compilerPass = new ResolveParameterPlaceHoldersPass();

$container = new ContainerBuilder();
$container->setParameter('foo.factory.class', 'FooFactory');
$fooDefinition = $container->register('foo', '%foo.factory.class%');
$fooDefinition->setFactoryClass('%foo.factory.class%');
$compilerPass->process($container);
$fooDefinition = $container->getDefinition('foo');

$this->assertSame('FooFactory', $fooDefinition->getFactoryClass());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ public function testClassParametersShouldBeResolved()
$this->assertSame('Foo', $this->fooDefinition->getClass());
}

public function testFactoryClassParametersShouldBeResolved()
{
$this->assertSame('FooFactory', $this->fooDefinition->getFactoryClass());
}

public function testClassOfFactoryParametersShouldBeResolved()
public function testFactoryParametersShouldBeResolved()
{
$this->assertSame(array('FooFactory', 'getFoo'), $this->fooDefinition->getFactory());
}
Expand Down Expand Up @@ -83,7 +78,6 @@ private function createContainerBuilder()
$containerBuilder->setParameter('alias.id', 'bar');

$fooDefinition = $containerBuilder->register('foo', '%foo.class%');
$fooDefinition->setFactoryClass('%foo.factory.class%');
$fooDefinition->setFactory(array('%foo.factory.class%', 'getFoo'));
$fooDefinition->setArguments(array('%foo.arg1%', '%foo.arg2%'));
$fooDefinition->addMethodCall('%foo.method%', array('%foo.arg1%', '%foo.arg2%'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@

use Symfony\Component\DependencyInjection\ContainerBuilder;

class ProjectServiceContainer extends ContainerBuilder
{
/**
* This file is included in Tests\Dumper\GraphvizDumperTest::testDumpWithFrozenCustomClassContainer
* and Tests\Dumper\XmlDumperTest::testCompiledContainerCanBeDumped.
*/
if (!class_exists('Container14\ProjectServiceContainer')) {
class ProjectServiceContainer extends ContainerBuilder
{
}
}

return new ProjectServiceContainer();