Php Fatal Error Cannot Redeclare Class Phpunit_framework_testcase
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta
Process Finished With Exit Code 255 Phpstorm
Discuss the workings and policies of this site About Us Learn phpunit cannot redeclare function more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us
Phpstorm Process Finished With Exit Code 1
Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like setup phpunit in phpstorm you, helping each other. Join them; it only takes a minute: Sign up Selenium RC - Cannot redeclare class PHPUnit_Framework_TestCase up vote 1 down vote favorite This I have found on the net in various places but with no actual solution. The default code for running a test is selenium = new Testing_Selenium("*firefox", "http://www.google.com"); $this->selenium->start(); } public function tearDown() { $this->selenium->stop(); } public function testGoogle() { $this->selenium->open("/"); $this->selenium->type("q", "hello world"); $this->selenium->click("btnG"); $this->selenium->waitForPageToLoad(10000); $this->assertRegExp("/Google Search/", $this->selenium->getTitle()); } } ?> This gives me the following error Fatal error: Cannot redeclare class PHPUnit_Framework_TestCase in /usr/lib/php/PHPUnit/Framework/TestCase.php on line 115 My include path looks like this .:/usr/lib/php/ZendLatest/library/:/usr/lib/php/:./PEAR/ Can anyone help me fix this? It isn't obvious where the class is being re-declared, is it on line 115 of the file mentioned above or somewhere else? Thanks selenium-rc php include-path share|improve this question asked Jan 12 '11 at 15:58 Jake N 7,38183678 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted I have solved this by changing the line require_once 'PHPUnit/Framework/TestCase.php'; To require_once 'PHPUnit/Framework.php'; The Framework.php file is the Bootstrap for PHPUnit and including this deals with all other includes. Including TestCase.php doesn't work because that isn't the Bootstrap file and thus doesn't load PHPUn
Sign
Process Finished With Exit Code 255 Java
in Pricing Blog Support Search GitHub phpstorm cannot find phpunit in include path This repository Watch 333 Star 5,527 Fork 1,294 sebastianbergmann/phpunit Code Issues
Phpunit Download
119 Pull requests 25 Projects 0 Wiki Pulse Graphs New issue PEAR + Composer = Fatal error: Cannot http://stackoverflow.com/questions/4670883/selenium-rc-cannot-redeclare-class-phpunit-framework-testcase redeclare class PHPUnit_Framework_TestCase ... #707 Closed robsonpeixoto opened this Issue Nov 4, 2012 · 6 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 6 participants robsonpeixoto commented Nov https://github.com/sebastianbergmann/phpunit/issues/707 4, 2012 I had the phpunit installed using PEAR. If I install the phpunit using composer for a specific projet, I got this error : $ phpunit . PHP Fatal error: Cannot redeclare class PHPUnit_Framework_TestCase in /Users/robinho/tmp/tst/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php on line 98 PHP Stack trace: PHP 1. {main}() /opt/local/bin/phpunit:0 PHP 2. PHPUnit_TextUI_Command::main() /opt/local/bin/phpunit:45 PHP 3. PHPUnit_TextUI_Command->run() /opt/local/lib/php/pear/PHPUnit/TextUI/Command.php:129 PHP 4. PHPUnit_Runner_BaseTestRunner->getTest() /opt/local/lib/php/pear/PHPUnit/TextUI/Command.php:150 PHP 5. PHPUnit_Framework_TestSuite->addTestFiles() /opt/local/lib/php/pear/PHPUnit/Runner/BaseTestRunner.php:96 PHP 6. PHPUnit_Framework_TestSuite->addTestFile() /opt/local/lib/php/pear/PHPUnit/Framework/TestSuite.php:416 PHP 7. PHPUnit_Util_Fileloader::checkAndLoad() /opt/local/lib/php/pear/PHPUnit/Framework/TestSuite.php:355 PHP 8. PHPUnit_Util_Fileloader::load() /opt/local/lib/php/pear/PHPUnit/Util/Fileloader.php:76 PHP 9. include_once() /opt/local/lib/php/pear/PHPUnit/Util/Fileloader.php:92 PHP 10. require_once() /Users/robinho/tmp/tst/vendor/phpunit/phpunit-mock-objects/Tests/MockBuilderTest.php:46 Fatal error: Cannot redeclare class PHPUnit_Framework_TestCase in /Users/robinho/tmp/tst/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php on line 98 Call Stack: 0.0003 232680 1. {main}() /opt/local/bin/phpunit:0 0.0058 919728 2. PHPUnit_TextUI_Command::main() /opt/local/bin/phpunit:45 0
♦ Locked 4 messages gaz1234 Reply | Threaded Open this post in threaded view ♦ ♦ | Report Content as http://zend-framework-community.634137.n4.nabble.com/PHP-Fatal-error-Cannot-redeclare-class-PHPUnit-Framework-TestCase-td4657687.html Inappropriate ♦ ♦ PHP Fatal error: Cannot redeclare class PHPUnit_Framework_TestCase I have received the below error after following the instructions for unit testing from http://zf2.readthedocs.org/en/release-2.0.3/user-guide/unit-testing.htmlPHP Fatal error: Cannot redeclare class PHPUnit_Framework_TestCase in /Users/gaz/Sites/zfTest/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php on line 98 line 98 of TestCase.php abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert implements PHPUnit_Framework_Test, PHPUnit_Framework_SelfDescribing { ....... Versions: ZF2: 2.0.2 cannot redeclare PHPUnit: 3.7.7 In an attempt to fix this I have upgraded to ZF2: 2.0.3 still no joy! I have gone back over the code to see if I have made a mistake but I can not find anything that would cause this error msg. Marco Pivetta Reply | Threaded Open this post process finished with in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ Re: PHP Fatal error: Cannot redeclare class PHPUnit_Framework_TestCase You should probably run /vendor/bin/phpunit instead of your system PHPUnit... Marco Pivetta http://twitter.com/Ocramiushttp://ocramius.github.com/On 19 October 2012 04:45, gaz1234 <[hidden email]> wrote: > I have received the below error after following the instructions for unit > testing from > > /http://zf2.readthedocs.org/en/release-2.0.3/user-guide/unit-testing.html/> > PHP Fatal error: Cannot redeclare class PHPUnit_Framework_TestCase in > > /Users/gaz/Sites/zfTest/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php > on line 98 > > line 98 of TestCase.php > > abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert > implements PHPUnit_Framework_Test, PHPUnit_Framework_SelfDescribing > { > ....... > > Versions: > ZF2: 2.0.2 > PHPUnit: 3.7.7 > > In an attempt to fix this I have upgraded to ZF2: 2.0.3 > > still no joy! > > I have gone back over the code to see if I have made a mistake but I can > not > find anything that would cause this err