removed usage of getmockBuilder() when not needed

This commit is contained in:
Fabien Potencier
2019-08-08 13:34:04 +02:00
parent 656c295ed9
commit c7b0a459ca
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ class ContainerRuntimeLoaderTest extends TestCase
{
public function testLoad()
{
$container = $this->getMockBuilder(ContainerInterface::class)->getMock();
$container = $this->createMock(ContainerInterface::class);
$container->expects($this->once())->method('has')->with('stdClass')->willReturn(true);
$container->expects($this->once())->method('get')->with('stdClass')->willReturn(new \stdClass());
@@ -30,7 +30,7 @@ class ContainerRuntimeLoaderTest extends TestCase
public function testLoadUnknownRuntimeReturnsNull()
{
$container = $this->getMockBuilder(ContainerInterface::class)->getMock();
$container = $this->createMock(ContainerInterface::class);
$container->expects($this->once())->method('has')->with('Foo');
$container->expects($this->never())->method('get');
+5 -5
View File
@@ -185,7 +185,7 @@ class EnvironmentTest extends TestCase
$templateName = __FUNCTION__;
$templateContent = __FUNCTION__;
$cache = $this->getMockBuilder(CacheInterface::class)->getMock();
$cache = $this->createMock(CacheInterface::class);
$loader = $this->getMockLoader($templateName, $templateContent);
$twig = new Environment($loader, ['cache' => $cache, 'auto_reload' => true, 'debug' => false]);
@@ -212,7 +212,7 @@ class EnvironmentTest extends TestCase
$templateName = __FUNCTION__;
$templateContent = __FUNCTION__;
$cache = $this->getMockBuilder(CacheInterface::class)->getMock();
$cache = $this->createMock(CacheInterface::class);
$loader = $this->getMockLoader($templateName, $templateContent);
$twig = new Environment($loader, ['cache' => $cache, 'auto_reload' => true, 'debug' => false]);
@@ -240,7 +240,7 @@ class EnvironmentTest extends TestCase
$templateName = __FUNCTION__;
$templateContent = __FUNCTION__;
$cache = $this->getMockBuilder(CacheInterface::class)->getMock();
$cache = $this->createMock(CacheInterface::class);
$loader = $this->getMockLoader($templateName, $templateContent);
$twig = new Environment($loader, ['cache' => $cache, 'auto_reload' => true, 'debug' => false]);
@@ -298,7 +298,7 @@ class EnvironmentTest extends TestCase
public function testAddMockExtension()
{
$extension = $this->getMockBuilder(ExtensionInterface::class)->getMock();
$extension = $this->createMock(ExtensionInterface::class);
$loader = new ArrayLoader(['page' => 'hey']);
$twig = new Environment($loader);
@@ -337,7 +337,7 @@ class EnvironmentTest extends TestCase
public function testAddRuntimeLoader()
{
$runtimeLoader = $this->getMockBuilder(RuntimeLoaderInterface::class)->getMock();
$runtimeLoader = $this->createMock(RuntimeLoaderInterface::class);
$runtimeLoader->expects($this->any())->method('load')->willReturn(new EnvironmentTest_Runtime());
$loader = new ArrayLoader([