I applied your hint to my test classes, using only the setup method and the
ini_restore function in the tearDown method and now everything works fine
;-)
I am able to run all tests with a single command:
.........................I.................I............... 60 / 177
.I.......................................................... 120 / 177
.........................I.......I......I................
Time: 16 seconds
OK, but incomplete or skipped tests!
Tests: 177, Assertions: 1876, Incomplete: 7.
I still have a little problem, on my development environment (Mac OS X) with
a large number of tests after a while I have an exception regarding a file
not found (a file that exists), the same thing happens if I run Zend FW
tests. This thing happens if I run tests using command line, if I use
ZendStudio the testsuite run correctly. Moreover on my staging machine and
on my production (both of them with Debian Linux) tests run fine.
The strange thing is that the php and phpunit version are the same:
On my mac:
Computer-di-Fabio:test fabionapoleoni$ php -v
PHP 5.2.6 (cli) (built: Jul 24 2008 08:32:16)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend
Technologies
with Xdebug v2.0.4, Copyright (c) 2002-2008, by Derick Rethans
with Zend Debugger v5.2.15, Copyright (c) 1999-2008, by Zend
Technologies
On the linux box:
fa...@host11:~$ phpunit --version
PHPUnit 3.3.15 by Sebastian Bergmann.
fa...@host11:~$ php -v
PHP 5.2.6-1+lenny3 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 26 2009
22:16:23)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
Any other advice is appreciated, but I can survive without the solution...
Thank you very much
Ralph Schindler-2 wrote:
>
> First, instead of using __construct(), use setup() and teardown()
>
> Those are documented here:
> http://www.phpunit.de/manual/current/en/fixtures.html#fixtures.more-setup-than-teardown
>
> Next, if you find the PHP state is not getting reset for certain values,
> in your teardown, you can always do something like this:
>
> ini_restore('include_path');
>
> That should reset the value to its original value.
>
> Hope that helps!
> -ralph
>
--
View this message in context:
http://www.nabble.com/Zend_Application-and-Unit-Testing-with-phpunit-make-inlude_path-growth-without-limits-tp24590803p24598768.html
Sent from the Zend Framework mailing list archive at Nabble.com.