浏览代码

Remove expectation on method call count (#4192)

It seems to vary depending on the version of some package (the build
with the lowest possible dependencies passes). Anyway, this is not
really what we want to test here, do we ?
Grégoire Paris 8 年之前
父节点
当前提交
d191bea9d1
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Tests/Controller/HelperControllerTest.php

+ 3 - 3
Tests/Controller/HelperControllerTest.php

@@ -260,7 +260,7 @@ class HelperControllerTest extends \PHPUnit_Framework_TestCase
         $container->expects($this->any())->method('get')->will($this->returnValue($admin));
 
         $adminExtension = $this->getMock('\Twig_ExtensionInterface', array('renderListElement', 'initRuntime', 'getTokenParsers', 'getNodeVisitors', 'getFilters', 'getTests', 'getFunctions', 'getOperators', 'getGlobals', 'getName'));
-        $adminExtension->expects($this->once())->method('getName')->will($this->returnValue('sonata_admin'));
+        $adminExtension->expects($this->any())->method('getName')->will($this->returnValue('sonata_admin'));
         $adminExtension->expects($this->once())->method('renderListElement')->will($this->returnValue('<foo />'));
 
         $twig = new \Twig_Environment($this->getMock('\Twig_LoaderInterface'));
@@ -320,7 +320,7 @@ class HelperControllerTest extends \PHPUnit_Framework_TestCase
 
         $formExtension = $this->getMock('\Twig_ExtensionInterface', array('renderListElement', 'initRuntime', 'getTokenParsers', 'getNodeVisitors', 'getFilters', 'getTests', 'getFunctions', 'getOperators', 'getGlobals', 'getName'));
 
-        $formExtension->expects($this->once())->method('getName')->will($this->returnValue('form'));
+        $formExtension->expects($this->any())->method('getName')->will($this->returnValue('form'));
         $formExtension->renderer = $mockRenderer;
 
         $twig = new \Twig_Environment($this->getMock('\Twig_LoaderInterface'));
@@ -404,7 +404,7 @@ class HelperControllerTest extends \PHPUnit_Framework_TestCase
             ->will($this->returnValue(new Response()));
 
         $formExtension = $this->getMock('\Twig_ExtensionInterface', array('renderListElement', 'initRuntime', 'getTokenParsers', 'getNodeVisitors', 'getFilters', 'getTests', 'getFunctions', 'getOperators', 'getGlobals', 'getName'));
-        $formExtension->expects($this->once())->method('getName')->will($this->returnValue('form'));
+        $formExtension->expects($this->any())->method('getName')->will($this->returnValue('form'));
         $formExtension->renderer = $mockRenderer;
 
         $twig = new \Twig_Environment($this->getMock('\Twig_LoaderInterface'));