I have two test cases, one returns a value, the next is supposed to use the return value.
class GenerateAckFeedTest extends PHPUnit_Framework_TestCase
{
public function testThankyouAckFeedErrors()
{
$ackFeed = array(1,2,3);
return $ackFeed;
}
/***
* @depends testCitiThankyouAckFeedErrors
*/
public function testCitiThankyouAckFeedGeneration(array $ackFeed)
{
}
}
The error I get is: There was 1 error:
1) testCitiThankyouAckFeedGeneration(GenerateAckFeedTest) Exception: ERRNO: 4096 TEXT: Argument 1 passed to GenerateAckFeedTest::testCitiThankyouAckFeedGeneration() must be an array, none given LOCATION: /home/pvarney/host-server/www/active/unit_tests/GenerateAckFeedTest.php, line 131, at November 15, 2010, 10:55 am Showing 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(Object:PHPUnit_Framework_TestResult) # line 677, file: /usr/share/php/PHPUnit/Framework/TestSuite.php 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/phpunit
I feel like I'm missing something fairly obvious.