ソースを参照

In Tests/Admin/BaseFieldDescriptionTest.php:
Use the original count of method('getFoo')

> @@ -90,9 +90,38 @@ public function testGetValue()
> $description->setOption('code', 'getFoo');
>
> $mock = $this->getMock('stdClass', array('getFoo'));
> - $mock->expects($this->once())->method('getFoo')->will($this->returnValue(42));
> + $mock->expects($this->any())->method('getFoo')->will($this->returnValue(42));

Brice LALU 12 年 前
コミット
d9a93df883
1 ファイル変更1 行追加1 行削除
  1. 1 1
      Tests/Admin/BaseFieldDescriptionTest.php

+ 1 - 1
Tests/Admin/BaseFieldDescriptionTest.php

@@ -90,7 +90,7 @@ class BaseFieldDescriptionTest extends \PHPUnit_Framework_TestCase
         $description->setOption('code', 'getFoo');
         $description->setOption('code', 'getFoo');
 
 
         $mock = $this->getMock('stdClass', array('getFoo'));
         $mock = $this->getMock('stdClass', array('getFoo'));
-        $mock->expects($this->any())->method('getFoo')->will($this->returnValue(42));
+        $mock->expects($this->once())->method('getFoo')->will($this->returnValue(42));
 
 
         $this->assertEquals(42, $description->getFieldValue($mock, 'fake'));
         $this->assertEquals(42, $description->getFieldValue($mock, 'fake'));