Skip to content

Commit f8115dc

Browse files
committed
fix components tests
Since #12006, the `ContainerBuilder` contains the `addExpressionLanguageProvider()` method which references a class from the ExpressionLanguage component. By default, the PHPUnit mock API tries to mock all methods of the class being doubled. Since the ExpressionLanguage component is not required to run the tests, creating the mock objects fails when the mock API fails to mock the `addExpressionLanguageProvider()` method.
1 parent 1a89988 commit f8115dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Tests/DependencyInjection/Compiler/TwigLoaderPassTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ class TwigLoaderPassTest extends \PHPUnit_Framework_TestCase
1919
{
2020
public function setUp()
2121
{
22-
$this->builder = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
22+
$this->builder = $this->getMock(
23+
'Symfony\Component\DependencyInjection\ContainerBuilder',
24+
array('hasDefinition', 'findTaggedServiceIds', 'setAlias', 'getDefinition')
25+
);
2326
$this->chainLoader = new Definition('loader');
2427
$this->pass = new TwigLoaderPass();
2528
}

0 commit comments

Comments
 (0)