Yes, I know it and in simpler cases I use it, but when I have tests involving
model or ZF classes I have problems because dataproviders funcion are called
before the setUp method and I instantiate Zend_Application in that method,
so a simple example like this won't work:

        public function dp() {
                return array (array (new Zend_Application()));
        }
        
        /**
         * @dataProvider dp
         * @param Zend_Application $a
         */
        public function testA($a) {
                $this->assertTrue($a instanceof Zend_Application);
        }

If in your opinion there is a better place to instantiate Zend_Application
(and mantain a reference to it as a shared fixture) any advice is welcome.



beberlei wrote:
> 
> 
> for exactly the cases you describe there is the concept of "dataproviders"
> 
> which is a loop around your test method, which is then allowed to accept
> different input parameters based on an outside data source.
> 
> http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Zend_Application-and-Unit-Testing-with-phpunit-make-inlude_path-growth-without-limits-tp24590803p24607823.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to