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 Discuss the workings and policies phpunit_extensions_seleniumtestcase not found of this site About Us Learn more about Stack Overflow the company
Phpunit Cannot Redeclare Function
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges phpunit_extensions_seleniumtestcase composer Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:
Phpunit_selenium
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 phpunit cannot redeclare class 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,36683678 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 PHPUnit correctly. share|improve this answer answered Jan 13 '11 at 10:45 Jake N 7,36683678 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Goo
Sign in Pricing Blog
Download Phpunit Selenium
Support Search GitHub This repository Watch
Phpunit Selenium Tutorial
332 Star 5,512 Fork 1,285 sebastianbergmann/phpunit Code Issues 118 Pull requests 21 phpunit_extensions_selenium2testcase Projects 0 Wiki Pulse Graphs New issue PEAR + Composer = Fatal error: Cannot redeclare class PHPUnit_Framework_TestCase ... #707 http://stackoverflow.com/questions/4670883/selenium-rc-cannot-redeclare-class-phpunit-framework-testcase 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 4, 2012 I had the phpunit installed https://github.com/sebastianbergmann/phpunit/issues/707 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.0058 919960 3. PHPUnit_TextUI_Command->run() /opt/local/lib/php/pear/PHPUnit/TextUI/Command.php:129 0.0079 1162824 4. PHPUnit_Runner_BaseTestRunner->getTest() /opt/local/lib/php/pear/PHPUnit/TextUI/Command.php:150 0.0689 1405400 5. PHPUnit_Framework_TestSuite->addTestFiles() /opt/local/lib/p
♦ Locked 4 messages gaz1234 Reply | Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ PHP Fatal error: Cannot redeclare class PHPUnit_Framework_TestCase I have http://zend-framework-community.634137.n4.nabble.com/PHP-Fatal-error-Cannot-redeclare-class-PHPUnit-Framework-TestCase-td4657687.html received the below error after following the instructions for unit testing from https://groups.google.com/d/topic/selenium-users/8HegXz0HYHc 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 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 cannot redeclare 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 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 cannot redeclare class 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 error msg. > > > > -- > View this message in context: > http://zend-framework-community.634137.n4.nabble.com/PHP-Fatal-error-Cannot-redeclare-class-PHPUnit-Framework-TestCase-tp4657687.html> Sent from the Zend Framework mailing list archive at Nabble.com. > > -- > List: [hidden email] > Info: http://framework.zend.com/archives> Unsubscribe: [hidden email] > > > luk Reply | Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ Re: PHP Fatal error: Cannot redeclare class PHPUnit_Framework_Test
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen