3

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.

3
  • 2
    What PHPUnit version are you using? Commented Nov 12, 2010 at 19:34
  • Can you provide a running example ? Maybe that will spawn some answers Commented Nov 15, 2010 at 8:22
  • I'm using phpunit 3.3.16. (Sorry for the late response, weekend came). I'll edit my example for a running example. Thanks a million, btw. Commented Nov 15, 2010 at 15:49

2 Answers 2

6

There were two issues, one I believe was the version (I would have accepted Anti's answer, but it was a comment), the other was the number of stars I was using in the comment.

I had

/***
 *
 */

I needed

/**
 *
 */
Sign up to request clarification or add additional context in comments.

1 Comment

Glad you figured it out yourself. I also added an answer, hopefully useful for someone else in the future.
2

According to PHPUnit/Util/Test.php getDependencies() method signature test dependencies were implemented in PHPUnit 3.4.0.

You were using 3.3.16 - an older version which does not support this.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.