Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

TestCase example is confusing. Why parameters in the setUp() method?

I'm reading the documentation about unit testing and in the example there is a class caleed UnitTestCase. In that class the setUp method signature is as follows:

public function setUp(Phalcon\DiInterface $di = NULL, Phalcon\Config $config = NULL)

My question is: since PHPUnit will instantiate that class automatically, why is the setUp method expecting arguments? How and when would someone pass arguments to that method? I'm scratching my head around it.



The penny finally dropped! I finally realized that the setUp() method is to be called by a child class using parent::setUp($di, $config). So obvious!