Merge branch '2.3' into 2.7
* 2.3: [DependencyInjection] Add coverage for all invalid arguments in exportParameters
This commit is contained in:
commit
3cd380da42
@ -16,6 +16,7 @@ use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
|
|||||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||||
use Symfony\Component\DependencyInjection\Reference;
|
use Symfony\Component\DependencyInjection\Reference;
|
||||||
use Symfony\Component\DependencyInjection\Definition;
|
use Symfony\Component\DependencyInjection\Definition;
|
||||||
|
use Symfony\Component\DependencyInjection\Variable;
|
||||||
|
|
||||||
class PhpDumperTest extends \PHPUnit_Framework_TestCase
|
class PhpDumperTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
@ -85,14 +86,24 @@ class PhpDumperTest extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @dataProvider provideInvalidParameters
|
||||||
* @expectedException \InvalidArgumentException
|
* @expectedException \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testExportParameters()
|
public function testExportParameters($parameters)
|
||||||
{
|
{
|
||||||
$dumper = new PhpDumper(new ContainerBuilder(new ParameterBag(array('foo' => new Reference('foo')))));
|
$dumper = new PhpDumper(new ContainerBuilder(new ParameterBag($parameters)));
|
||||||
$dumper->dump();
|
$dumper->dump();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function provideInvalidParameters()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
array(array('foo' => new Definition('stdClass'))),
|
||||||
|
array(array('foo' => new Reference('foo'))),
|
||||||
|
array(array('foo' => new Variable('foo'))),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function testAddParameters()
|
public function testAddParameters()
|
||||||
{
|
{
|
||||||
$container = include self::$fixturesPath.'/containers/container8.php';
|
$container = include self::$fixturesPath.'/containers/container8.php';
|
||||||
|
Reference in New Issue
Block a user