我有两个测试用例,一个返回一个值,下一个应该使用返回值.
class GenerateAckFeedTest extends PHPUnit_Framework_TestCase
{
public function testThankyouAckFeedErrors()
{
$ackFeed = array(1,2,3);
return $ackFeed;
}
/***
* @depends testCitiThankyouAckFeedErrors
*/
public function testCitiThankyouAckFeedGeneration(array $ackFeed)
{
}
}
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:有1个错误:
1)testCitiThankyouAckFeedGeneration(GenerateAckFeedTest)异常:ERRNO:4096 TEXT:参数1传递给GenerateAckFeedTest :: testCitiThankyouAckFeedGeneration()必须是一个数组,没有给出LOCATION:/home/pvarney/host-server/www/active/unit_tests/GenerateAckFeedTest.php ,131行,2010年11月15日,上午10:55显示backtrace:GenerateAckFeedTest.testCitiThankyouAckFeedGeneration()#line 0,file:unknown ReflectionMethod.invoke(Object:GenerateAckFeedTest)#line 489,file:/ usr/share/php/PHPUnit/Framework/TestCase.php PHPUnit_Framework_TestCase.runTest()#line 404,file:/usr/share/php/PHPUnit/Framework/TestCase.php PHPUnit_Framework_TestCase.runBare()#line 607,file:/ usr/share/php/PHPUnit/Framework/TestResult.php PHPUnit_Framework_TestResult.run(Object:GenerateAckFeedTest)#line 375,file:/usr/share/php/PHPUnit/Framework/TestCase.php PHPUnit_Framework_TestCase.run(对象:并向PHPUnit_Framework_TestResult)#线677,文件:/usr/share/php/PHPUnit/Framework/TestSuite.php PHPUnit_Framework_TestSuite.runTest(对象:GenerateAckFeedTest,对象:PHPUnit_Framework_TestResult)#line 658,file:/usr/share/php/PHPUnit/Framework/TestSuite.php PHPUnit_Framework_TestSuite.run(Object:PHPUnit_Framework_TestResult,false,Array [0],Array [0])#line 324,file: /usr/share/php/PHPUnit/TextUI/TestRunner.php PHPUnit_TextUI_TestRunner.doRun(对象:PHPUnit_Framework_TestSuite,Array [4])#line 128,file:/usr/share/php/PHPUnit/TextUI/Command.php PHPUnit_TextUI_Command.main ()#line 52,file:/ usr/bin/phpunitphp PHPUnit_Framework_TestSuite.runTest(Object:GenerateAckFeedTest,Object:PHPUnit_Framework_TestResult)#line 658,file:/usr/share/php/PHPUnit/Framework/TestSuite.php PHPUnit_Framework_TestSuite.run(Object:PHPUnit_Framework_TestResult,false,Array [0],Array [ 0])#line 324,file:/usr/share/php/PHPUnit/TextUI/TestRunner.php PHPUnit_TextUI_TestRunner.doRun(Object:PHPUnit_Framework_TestSuite,Array [4])#line 128,file:/ usr/share/php/PHPUnit /TextUI/Command.php PHPUnit_TextUI_Command.main()#line 52,file:/ usr/bin/phpunitphp PHPUnit_Framework_TestSuite.runTest(Object:GenerateAckFeedTest,Object:PHPUnit_Framework_TestResult)#line 658,file:/usr/share/php/PHPUnit/Framework/TestSuite.php PHPUnit_Framework_TestSuite.run(Object:PHPUnit_Framework_TestResult,false,Array [0],Array [ 0])#line 324,file:/usr/share/php/PHPUnit/TextUI/TestRunner.php PHPUnit_TextUI_TestRunner.doRun(Object:PHPUnit_Framework_TestSuite,Array [4])#line 128,file:/ usr/share/php/PHPUnit /TextUI/Command.php PHPUnit_TextUI_Command.main()#line 52,file:/ usr/bin/phpunitphp PHPUnit_TextUI_TestRunner.doRun(对象:PHPUnit_Framework_TestSuite,Array [4])#line 128,file:/usr/share/php/PHPUnit/TextUI/Command.php PHPUnit_TextUI_Command.main()#line 52,file:/ usr/bin/PHPUnit的php PHPUnit_TextUI_TestRunner.doRun(对象:PHPUnit_Framework_TestSuite,Array [4])#line 128,file:/usr/share/php/PHPUnit/TextUI/Command.php PHPUnit_TextUI_Command.main()#line 52,file:/ usr/bin/PHPUnit的
我觉得我错过了一些相当明显的东西.
有两个问题,一个我认为是版本(我会接受Anti的回答,但这是一个评论),另一个是我在评论中使用的明星数量.
我有
/***
*
*/
Run Code Online (Sandbox Code Playgroud)
我需要
/**
*
*/
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
742 次 |
| 最近记录: |