News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Mike Purcell's Blog:
PHPUnit - Constant Already Defined - -process-isolation
June 07, 2012 @ 08:43:25

In this new post from Mike Purcell shares a solution to an error he came across in his unit testing - a "Constant already defined" message - and how he fixed it.

When upgrading the unit tests I had no problem, it was only when I was trying to integrate into CruiseControl that this was happening. Well after some time, I finally figured out the issue was the "ant" command to execute the unit tests was passing the -process-isolation flag to phpunit.

He found that when he called it with that flag, it was executed twice, resulting in the "already defined" message the second time. He fixed it by removing the extra flag. Another alternative is to wrap your constant definitions (and anything that dosen't need to be called/created again) in an "is defined" check.

0 comments voice your opinion now!
phpunit processisolation error constant


blog comments powered by Disqus

Similar Posts

Sebastian Bergmann's Blog: Google Summer of Code 2007

Kevin Waterson's Blog: When Tutorials Attack

Jacob Santos' Blog: What is your C.R.A.P. Index?

Test.ical.ly Blog: Best practice of PHPUnit testing a symfony 1.4 plugin

Chris Hartjes' Blog: Snakes and Elephants Playing Nice Together: PHPUnit and py.test with Hudson


Community Events

Don't see your event here?
Let us know!


language introduction php7 application interview opinion performance conference api voicesoftheelephpant release symfony2 configure example community laravel podcast series framework library

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework