Search Results

Search found 147 results on 6 pages for 'phpunit'.

Page 1/6 | 1 2 3 4 5 6  | Next Page >

  • cannt run phpunit tests on bash ubuntu 11.10

    - by Mohamad Elbialy
    i'm working with ubuntu 11.10 as root on my local machine, i've installed xampp 1.7.7 and i'm a newbie to ubuntu, while following a tutorial on sitepoint(http://www.sitepoint.com/getting-started-with-pear/) on how to install pear to use PhpUnit, i didnt notice it then, but it seems that i installed or used an existing php version 5.3.6 in CL to do that, also the pear installation was built on this version, while xampp being installed,i now have two versions of php,xampp's 5.3.8 and the 5.3.6, anyway, what i want to do is to use the existing xampp php version and build pear on that, to make all my work through xampp.so my questions are: how to uninstall the php V5.3.6 and it's pear installation? how to link the CL with the php ver. of xampp? how to build the next pear installation on the php ver. of xampp? i want all my web dev. work through xampp, is there anything else i need to unistall, to avoid this confusion? 4. i did the following in attampet to solve the problem: i wrote this in bash: gedit ~/.bashrc i added that to the end of ~/.bashrc file in attempt to change environment path: export PATH=/opt/lampp/bin:$PATH export PATH=/opt/lampp/lib/php:$PATH export PATH=/opt/lampp/lib/php/PHPUnit/pearcmd.php:$PATH i checked the php and pear version using 'php -v' and 'pear list' i got an ouput of: PHP 5.3.8 (cli) (built: Sep 19 2011 13:29:27) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies and for pear: Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.3.9 stable Console_Getopt 1.3.1 stable PEAR 1.9.4 stable PHPUnit 1.3.2 stable Structures_Graph 1.0.4 stable XML_Util 1.2.1 stable when i run: 'phpunit MessageTest.php': i get PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38 Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38 PHP Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.:/php/includes:/opt/lampp/lib/php:/opt/lampp/bin:/opt/lampp/lib/php/PEAR') in /usr/bin/phpunit on line 38 5.i ran the following commands as reported in other questions as a solution to that error: sudo apt-get remove phpunit sudo pear channel-discover pear.phpunit.de sudo pear channel-discover pear.symfony-project.com sudo pear channel-discover components.ez.no sudo pear update-channels sudo pear upgrade-all sudo pear install --alldeps phpunit/PHPUnit sudo apt-get install phpunit and updated include path of php.ini to be: include_path = ".:/php/includes:/opt/lampp/lib/php:/opt/lampp/bin:/opt/lampp/lib/php/PEAR" the php file MessageTest.php: <?php require 'PHPUnit/Autoload.php'; $path = '/opt/lampp/lib/php/PEAR'; set_include_path(get_include_path() . PATH_SEPARATOR . $path); require_once 'PHPUnit/Framework/TestCase.php'; require_once 'Message/Controller/MessageController.php'; class MessageTest extends PHPUnit_Framework_TestCase{ private $message; public function setUp() { $this->message = new MessageController(); } public function tearDown() { } public function testRepeat(){ $yell = "Hello, Any One Out There?"; $this->message->repeat($yell); //sending a request $returnedMessage = $this->message->repeat($yell);//get a response $this->assertEquals($returnedMessage, $yell); } } ?> MessageController class from MessageController.php that i'm trying to test <?php class MessageController { public function actionHelloWorld() { echo 'helloWorld'; } public function repeat($inputString){ return $inputString; } } $msg = new MessageController; ?> I'm not using any PHP framework, i just made the files and classes sounds like it that's all. and still i get the same error: PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38 PHP Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.:/php/includes:/opt/lampp/lib/php:/opt/lampp/bin:/opt/lampp/lib/php/PEAR') in /usr/bin/phpunit on line 38 sure, i'm getting demanding here, i've wasted a lot of time and got really frustrated over this, hope you guys dont get bored reading through my questions, i appreciate your help thanks in advance, Mohamad elbialy

    Read the article

  • Installing PHPUnit via PEAR

    - by Ondrej Slinták
    I have problems installing PHPUnit 3.4.6 via PEAR 1.9.0. After I discover channel pear.phpunit.de and try to use one of following commands: pear install phpunit/PHPUnit pear install --alldeps phpunit/PHPUnit pear install --onlyreqdeps phpunit/PHPUnit it fails, giving me following error: No releases available for package "pear.phpunit.de/PHPUnit" install failed I found several threads from people with the same problem, but upgrading PEAR to the newest version usually worked for them. Also there seems to be close to no tutorials for installing PHPUnit for Windows. EDIT: I've also tried to change prefered_state to beta; didn't help. I've also tried to get list of all available packages: pear remote-list -c phpunit It gives me another error: Cannot download non-http URL "/c/categories.xml"

    Read the article

  • Cannot redeclare class error when generating PHPUnit code coverage report

    - by Cobby
    Starting a project with Zend Framework 1.10 and Doctrine 2 (Beta1). I am using namespaces in my own library code. When generating code coverage reports I get a Fatal Error about Redeclaring a class. To provide more info, I've commented out the xdebug_disable() call in my phpunit executable so you can see the function trace (disabled local variables output because there was too much output). Here's my Terminal output: $ phpunit PHPUnit 3.4.12 by Sebastian Bergmann. ........ Time: 4 seconds, Memory: 16.50Mb OK (8 tests, 14 assertions) Generating code coverage report, this may take a moment.PHP Fatal error: Cannot redeclare class Cob\Application\Resource\HelperBroker in /Users/Cobby/Sites/project/trunk/code/library/Cob/Application/Resource/HelperBroker.php on line 93 PHP Stack trace: PHP 1. {main}() /usr/local/zend/bin/phpunit:0 PHP 2. PHPUnit_TextUI_Command::main() /usr/local/zend/bin/phpunit:54 PHP 3. PHPUnit_TextUI_Command-run() /usr/local/zend/share/pear/PHPUnit/TextUI/Command.php:146 PHP 4. PHPUnit_TextUI_TestRunner-doRun() /usr/local/zend/share/pear/PHPUnit/TextUI/Command.php:213 PHP 5. PHPUnit_Util_Report::render() /usr/local/zend/share/pear/PHPUnit/TextUI/TestRunner.php:478 PHP 6. PHPUnit_Framework_TestResult-getCodeCoverageInformation() /usr/local/zend/share/pear/PHPUnit/Util/Report.php:97 PHP 7. PHPUnit_Util_Filter::getFilteredCodeCoverage() /usr/local/zend/share/pear/PHPUnit/Framework/TestResult.php:623 Fatal error: Cannot redeclare class Cob\Application\Resource\HelperBroker in /Users/Cobby/Sites/project/trunk/code/library/Cob/Application/Resource/HelperBroker.php on line 93 Call Stack: 0.0004 322888 1. {main}() /usr/local/zend/bin/phpunit:0 0.0816 4114628 2. PHPUnit_TextUI_Command::main() /usr/local/zend/bin/phpunit:54 0.0817 4114964 3. PHPUnit_TextUI_Command-run() /usr/local/zend/share/pear/PHPUnit/TextUI/Command.php:146 0.1151 5435528 4. PHPUnit_TextUI_TestRunner-doRun() /usr/local/zend/share/pear/PHPUnit/TextUI/Command.php:213 4.2931 16690760 5. PHPUnit_Util_Report::render() /usr/local/zend/share/pear/PHPUnit/TextUI/TestRunner.php:478 4.2931 16691120 6. PHPUnit_Framework_TestResult-getCodeCoverageInformation() /usr/local/zend/share/pear/PHPUnit/Util/Report.php:97 4.2931 16691148 7. PHPUnit_Util_Filter::getFilteredCodeCoverage() /usr/local/zend/share/pear/PHPUnit/Framework/TestResult.php:623 (I have no idea why it shows the error twice...?) And here is my phpunit.xml: <phpunit bootstrap="./code/tests/application/bootstrap.php" colors="true"> <!-- bootstrap.php changes directory to trunk/code/tests, all paths below are relative to this directory. --> <testsuite name="My Promotions"> <directory>./</directory> </testsuite> <filter> <whitelist> <directory suffix=".php">../application</directory> <directory suffix=".php">../library/Cob</directory> <exclude> <!-- By adding the below line I can remove the error --> <file>../library/Cob/Application/Resource/HelperBroker.php</file> <directory suffix=".phtml">../application</directory> <directory suffix=".php">../application/doctrine</directory> <file>../application/Bootstrap.php</file> <directory suffix=".php">../library/Cob/Tools</directory> </exclude> </whitelist> </filter> <logging> <log type="junit" target="../../build/reports/tests/report.xml" /> <log type="coverage-html" target="../../build/reports/coverage" charset="UTF-8" yui="true" highlight="true" lowUpperBound="50" highLowerBound="80" /> </logging> </phpunit> I have added a tag inside the which seams to hide this problem. I do have another application resource but it doesn't seam to have a problem (the other one is a Doctrine 2 resource). I'm not sure why it is specific to this class, my entire library is autoloaded so their isn't any include/require calls anywhere. I guess it should be noted that HelperBroker is the first file in the filesystem stemming out from library/Cob I am on Snow Leopard with the latest/recent versions of all software (Zend Server, Zend Framework, Doctrine 2 Beta1, Phing, PHPUnit, PEAR).

    Read the article

  • PHPUnit XDebug required

    - by poru
    Hello, I finished installation of PHPUnit, it works but I don't get a code coverage report. I'm working on windows. My phpunit.xml <phpunit bootstrap="./application/bootstrap.php" colors="false"> <testsuite name="Application"> <directory>./</directory> </testsuite> <filter> <whitelist> <directory suffix=".php">./application</directory> <directory suffix=".php">./library/Application</directory> <exclude> <directory suffix=".php">../application/libraries/Zend</directory> <directory suffix=".php">../application/controllers</directory> <directory suffix=".phtml">./application/</directory> <file>./application/Bootstrap.php</file> </exclude> </whitelist> </filter> <logging> <log type="coverage-html" target="./log/report" charset="UTF-8" yui="true" highlight="true" lowUpperBound="50" highLowerBound="80" /> <log type="testdox" target="./log/testdox.html" /> </logging> If I run on cmd phpunit --configuration phpunit.xml it works so far, but PHPUnit doesn't create a code coverage report. If I run phpunit --configuration phpunit.xml --coverage-html \log or phpunit --configuration phpunit.xml --coverage-html log I get the error The Xdebug extension is not loaded. But I installed it (version 2.0.5)! phpinfo() says I installed it, also var_dump(extension_loaded('xdebug')) I get true. I installed it as Zend Extension and I tried also as normal extension. Bot worked, but PHPUnit says everytime Xdebug is not loaded!

    Read the article

  • unable to install latest phpUnit in Ubuntu 10.04

    - by Dex Barrett
    I'm trying to install PHPUnit in Ubuntu 10.04 but I get these error messages sudo pear install -a pear.phpunit.de/PHPUnit Duplicate package channel://pear.phpunit.de/File_Iterator-1.3.3 found Duplicate package channel://pear.phpunit.de/File_Iterator-1.3.2 found install failed I tried reinstalling PEAR, upgrading it; updated the PEAR and PHPUnit channel; cleared the PEAR's cache but still no luck, I keep getting the same error. Does anyone have the same problem and know how to solve it? Thank you.

    Read the article

  • How do I run all my PHPUnit tests?

    - by JJ
    I have script called Script.php and tests for it in Tests/Script.php, but when I run phpunit Tests it does not execute any tests in my test file. How do I run all my tests with phpunit? PHPUnit 3.3.17, PHP 5.2.6-3ubuntu4.2, latest Ubuntu Output: $ phpunit Tests PHPUnit 3.3.17 by Sebastian Bergmann. Time: 0 seconds OK (0 tests, 0 assertions) And here are my script and test files: Script.php <?php function returnsTrue() { return TRUE; } ?> Tests/Script.php <?php require_once 'PHPUnit/Framework.php'; require_once 'Script.php' class TestingOne extends PHPUnit_Framework_TestCase { public function testTrue() { $this->assertEquals(TRUE, returnsTrue()); } public function testFalse() { $this->assertEquals(FALSE, returnsTrue()); } } class TestingTwo extends PHPUnit_Framework_TestCase { public function testTrue() { $this->assertEquals(TRUE, returnsTrue()); } public function testFalse() { $this->assertEquals(FALSE, returnsTrue()); } } ?>

    Read the article

  • Packaging PHPUnit tests as a PHAR archive?

    - by therefromhere
    Is it possible to package PHPUnit tests as a PHAR archive, and run them using phpunit? I've created a .phar with the follow script: $cPhar = new Phar('mytests-archive.phar', 0); $cPhar->addFile('mytest.php'); $stub = <<<ENDSTUB #! /usr/bin/php <?php Phar::mapPhar('mytest-archive.phar'); require 'phar://mytests-archive.phar/mytest.php'; __HALT_COMPILER(); ENDSTUB; $cPhar->setStub($stub); $cPhar->compressFiles(Phar::GZ); $cPhar->stopBuffering(); But when I then try running the resulting archive as follows: phpunit mytests-archive.phar I get the error message: #! /usr/bin/php PHPUnit 3.3.17 by Sebastian Bergmann. Class MyTestClass could not be found in /path/to/mytests-archive.phar Does PHPUnit not support PHAR files, or am I missing a step in my build script? (This is my first attempt at using PHAR)

    Read the article

  • PHPUnit 3.6.10 + ZendFramework 1.11.11 + NetBeans 7.1

    - by Vegetus
    When I create a controller with following through Zend_Tool command: create controller NameController ... netbeans creates a new controller successfully. BUT, it sends a message in the output window: PHPUnit is required in order to generate controller test stubs. How do I get Netbeans to automatically create a class with phpunit testing? I searched the net and thousands solutions so far not able to solve ... Important Notes: Have already installed the pear Already installed phpunit Already included 'phpunit' in the include_path Has created a file and includes zf.ini too in the include_path Options already configured netbeans, where I informed the directory phpunit.bat. Is it a bug in NetBeans? See:

    Read the article

  • PHPUnit installed but class PHPUnit_TestCase not found

    - by Greg K
    Talk about falling at the first hurdle. My test script: <?php require_once('PHPUnit/Framework.php'); class TransferResponseTest extends PHPUnit_TestCase { ... } Running my test case: $ phpunit TransferResponseTest Fatal error: Class 'PHPUnit_TestCase' not found in /Volumes/Data/greg/code/syndicate/tests/TransferResponseTest.php on line 5 $ php -i | grep include_path include_path => .:/usr/lib/php => .:/usr/lib/php $ ls -l /usr/lib/php/PHPUnit/ total 8 drwxr-xr-x 16 root wheel 544 27 Mar 19:03 Extensions drwxr-xr-x 28 root wheel 952 27 Mar 19:03 Framework -rw-r--r-- 1 root wheel 3193 27 Mar 19:03 Framework.php drwxr-xr-x 8 root wheel 272 27 Mar 19:03 Runner drwxr-xr-x 5 root wheel 170 27 Mar 19:03 TextUI drwxr-xr-x 32 root wheel 1088 27 Mar 19:03 Util I copied /etc/php.ini-default to /etc/php.ini and explicitly specified the include path as /usr/lib/php/ with an end / but still no success. $ php -i | grep include_path include_path => .:/usr/lib/php/ => .:/usr/lib/php/ $ phpunit TransferResponseTest.php PHP Fatal error: Class 'PHPUnit_TestCase' not found in /Volumes/Data/greg/code/syndicate/tests/TransferResponseTest.php on line 5 $ phpunit --version PHPUnit 3.4.11 by Sebastian Bergmann. Any ideas?

    Read the article

  • Phpunit Testing with Codeignitor and Doctrine

    - by Bhavin Rana
    I M Currently using Phpunit PHP Testing Framework. But i have problems in using combination of Doctrine ORM and Codeignitor PHP Framework. PHPUnit not working with the Combine Codeignitor and Doctrine so much errors there.. what should do? any body can solve this problem? Code ignitor and PHPUnit User plz contact. well i ve used the foo stack for codeignitor //Bhavin A Rana

    Read the article

  • PHPUnit won't run tests by directory

    - by Frank Schwieterman
    I'm new to PHP, trying to get multiple tests to run at once. I was hoping to just run all tests in a directory, which seemed to work awhile (instead of using a phpunit.xml). I am able to run a test individually like so: phpunit FirstUnitTest sites\all\modules\experiment\unit-tests\FirstUnitTest.lua But when I try to run the same test by directory, its not found. I try using: phpunit sites\all\modules\experiment\unit-tests Does anyone know why this may not work?

    Read the article

  • Creating Mock object of Interface with type-hint in method fails on PHPUnit

    - by Mark
    I created the following interface: <?php interface Action { public function execute(\requests\Request $request, array $params); } Then I try to make a Mock object of this interface with PHPUnit 3.4, but I get the following error: Fatal error: Declaration of Mock_Action_b389c0b1::execute() must be compatible with that of Action::execute() in D:\Xampp\xampp\php\PEAR\PHPUnit\Framework\TestCase.php(1121) : eval()'d code on line 2 I looked through the stack trace I got from PHPUnit and found that it creates a Mock object that implements the interface Action, but creates the execute method in the following way: <?php public function execute($request, array $params) As you can see, PHPUnit takes over the array type-hint, but forgets about \requests\Request. Which obviously leads to an error. Does anyone knows a workaround for this error? I also tried it without namespaces, but I still get the same error.

    Read the article

  • How to set a global before PHPUnit's skeleton-test is run

    - by ministerOfPower
    We set a global in our prepend file used to form the path for our require_once calls. For example: require_once($GLOBALS['root'].'/library/particleboard/JsonUtil.php'); Problem is, when I run PHPUnit's skeleton test builder, the prepend file is not run, so the global is never set. When I run cd /company/trunk/queue/process; phpunit --skeleton-test QueueProcessView PHPUnit tries to resolve a require_once in QueueProcessView, but since the $GLOBALS['root'] is never set, I get a fatal error when including the required file. For example, to PHPUnit, what should be require_once(/code/trunk/library/particleboard/JsonUtil.php) is resolved as require_once(/library/particleboard/JsonUtil.php) Notice the missing root. Does anyone know if the skeleton-test code has some way to call PHP file before it is run? In this I could set my GLOBAL['root'] in this file. Any other creative solutions would be appreciated.

    Read the article

  • How to execute PHPUnit?

    - by user1280667
    PHPUnit can execute script like this: phpunit --log-junit classname filename.php (i need the XML report , for my continus integreation platform) but my problem is that i work with a MVC framework and all pages are called through pathofproject/indexCLI.php module=moduleName class=className ect with 3 arguments in total(when i use the shell commande and path/index.php argum=... with url) so i cant call phpunit pathofproject/indexCLI.php module=moduleName class=className . So i think to a lot of solution , i hope you can help me to use one of them. first how can i use phpunit commande with this type of calling, because i cant do it because he is waiting a classname and a filename (default comportement) if it possible !! when i call the same link in shell like this : php path/indexCLI.php module="blabla" ect ... i have the result of assertion in my consol , but cant use XML Junit option , can i do it ? my last solution is to call the link in a navigator like mozzila , but i dont know how to say to phpunit runner to chose XML report and not HTML report. the aim for me , is to have a XML report .

    Read the article

  • PHPUnit Command Line Include Path

    - by thatidiotguy
    So I have a project structure like so: MyProject/ src/ //subfolders and source code ..... tests/ package/ MyTest.php I am trying to run the unit tests in MyTest.php with PHPUnit but it has a use statement for PHP classes located in the src folder. So I tried to use the include-path directive for PHPUnit like so: (I am in the directory with MyTest.php) phpunit --include-path ~/workspace/MyProject/src/ MyTest Unfortunately execution is halting at the first use statement. What gives?

    Read the article

  • PHPUnit not working with netbeans 7.2.1

    - by user1578653
    I have just upgraded to netbeans 7.2.1 and phpunit is not working. I get the error:- Cannot run program C:\wamp\bin\php\php5.3.5\PEAR\phpunit-skelgen": CreateProcess error=193, %1 is not a valid Win32 application" when I try to generate PHPUnit tests. The only thing I can think of is that I seem to have a 64 bit version of netbeans installed - could this be the problem? If so, can anyone point me to a 32 bit version, because I couldn't see one on the website?

    Read the article

  • How do I configure CI hudson with PHPunit and how do I run phpunit using hudson?

    - by Vinesh
    Hi, I am getting following error mentioned below. Help is much needed for this... kindly go through the errors. Started by an SCM change Updating https://suppliesguys.unfuddle.com/svn/suppliesguys_frontend2/Frontend-Texity/src U sites\all\modules\print\print_pdf\print_pdf.pages.inc At revision 1134 [workspace] $ sh -xe C:\WINDOWS\TEMP\hudson6292587174545072503.sh The system cannot find the file specified FATAL: command execution failed java.io.IOException: Cannot run program "sh" (in directory "E:\Projects\Hudson.hudson\jobs\TSG\workspace"): CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.(Proc.java:149) at hudson.Proc$LocalProc.(Proc.java:121) at hudson.Launcher$LocalLauncher.launch(Launcher.java:636) at hudson.Launcher$ProcStarter.start(Launcher.java:271) at hudson.Launcher$ProcStarter.join(Launcher.java:278) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:83) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:58) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:584) at hudson.model.Build$RunnerImpl.build(Build.java:174) at hudson.model.Build$RunnerImpl.doRun(Build.java:138) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416) at hudson.model.Run.run(Run.java:1244) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:122) Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 17 more Publishing Javadoc Publishing Clover coverage report... No Clover report will be published due to a Build Failure [xUnit] Starting to record. [xUnit] [PHPUnit] - Use the embedded style sheet. [xUnit] [ERROR] - No test report file(s) were found with the pattern 'build/logs/phpunit.xml' relative to 'E:\Projects\Hudson.hudson\jobs\TSG\workspace' for the testing framework 'PHPUnit'. Did you enter a pattern relative to the correct directory? Did you generate the result report(s) for 'PHPUnit'? [xUnit] Stopping recording. Finished: FAILURE

    Read the article

  • echo command not found while testing selenium with phpunit

    - by Bill Szerdy
    I am getting an ERROR: Unknown command: 'echo' executing a selenium script with phpunit. Based on the output that echo command should be included in my version of PHPUnit. The selenium script does execute successfully in the firefox selenium IDE. mkdir_build: phpunit: [exec] PHPUnit 3.4.12 by Sebastian Bergmann. [exec] [exec] . [exec] TestFull [exec] E [exec] [exec] Time: 11 seconds, Memory: 6.50Mb [exec] [exec] There was 1 error: [exec] [exec] 1) TestFull::testNumberOne [exec] PHPUnit_Framework_Exception: Response from Selenium RC server for testComplete(). [exec] ERROR: Unknown command: 'echo'. [exec] [exec] [exec] /directory/to/tests/TestFull.php:14 [exec] [exec] FAILURES! [exec] Tests: 1, Assertions: 0, Errors: 1. And the RC server output: $ java -jar selenium-server.jar -port 4445 -debug 13:23:08.426 INFO - Java: Sun Microsystems Inc. 14.2-b01 13:23:08.428 INFO - OS: Linux 2.6.28-15-server i386 13:23:08.439 INFO - v2.0 [a2], with Core v2.0 [a2] 13:23:08.439 INFO - Selenium server running in debug mode. 13:25:05.661 DEBUG - ---------retrieving CommandQueue for sel_93352 13:25:05.662 DEBUG - Browser 2c8b3b5657a640db9fb278ecbd01049e/:top sel_93352 posted ERROR: Unknown command: 'echo' 13:25:05.662 DEBUG - ---------retrieving CommandQueue for sel_93352 13:25:05.662 DEBUG - putting command: ERROR: Unknown command: 'echo' 13:25:05.662 DEBUG - ..command put?: true 13:25:05.662 DEBUG - sel_93352 commandHolder sel_93352 getCommand() called 13:25:05.662 DEBUG - waiting for data for at most 10 more s 13:25:05.662 DEBUG - data from polling: ERROR: Unknown command: 'echo' 13:25:05.662 DEBUG - sel_93352 commandResultHolder sel_93352 getResult() -> ERROR: Unknown command: 'echo' 13:25:05.663 DEBUG - Got result: ERROR: Unknown command: 'echo' on session 2c8b3b5657a640db9fb278ecbd01049e 13:25:05.663 INFO - Got result: ERROR: Unknown command: 'echo' on session 2c8b3b5657a640db9fb278ecbd01049e 13:25:05.663 DEBUG - Handled by org.openqa.selenium.server.SeleniumDriverResourceHandler in HttpContext[/selenium-server,/selenium-server] 13:25:05.663 DEBUG - RESPONSE: HTTP/1.1 200 OK Date: Wed, 07 Apr 2010 20:25:05 GMT Server: Jetty/5.1.x (Linux/2.6.28-15-server i386 java/1.6.0_16 Cache-Control: no-cache Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: text/plain Connection: close

    Read the article

  • PHPUnit reporting "Aborted" no matter what tests are run

    - by GrumpyCanuck
    Having a weird problem with PHPUnit. We're using PHPUnit as part of a continuous integration environment, that contains one app written using Zend Framework and one app written using CodeIgniter. Unit tests run just fine under Zend Framework, but whenever I run the tests for CodeIgniter using fooStack's CIUnit bridge, I always get the same problem at the end: PHPUnit 3.4.14 by Sebastian Bergmann. ............... . Time: 1 second, Memory: 7.00Mb OK (16 tests, 14 assertions) Aborted First off, I do not know what those empty spaces between the . means. Secondly, no matter what test I run (all of them or each one separately) I get the same Aborted message at the very end. The tests themselves do not contain any exit or die statements. When I run the same version of PHPUnit on my laptop (running OS-X Snow Leopard and same version of Zend Server Community Edition) I do not get that aborted message. Running PHP 5.3.2 on Ubuntu installed using Zend Server Community Edition. Any help with this would be greatly appreciated.

    Read the article

  • Why PHPUnit test doesn't fail?

    - by JohnM2
    I have a test method which looks like that: $row = $this->GetRowFromUserTable($id); $this->asserLessThan(time(), time($row['last_update'])); When $row is null access to $row['last_update'] should trigger a NOTICE and this test should fail, but it doesn't. This code fails on first assert, so I know $db_row is null (fixture is the same): $row = $this->GetRowFromUserTable($id); $this->asserNotNull($row); $this->asserLessThan(time(), time($row['last_update'])); When I write this: $row = $this->GetRowFromUserTable($id); $this->assertEquals(E_ALL, error_reporting()); $this->asserLessThan(time(), time($row['last_update'])); it successes, so I am also sure that error_reproting is right and this situation must have something to do with PHPUnit. I use PHPUnit 3.5.6 I read this question: Can I make PHPUnit fail if the code throws a notice? but the answer suggests to use newer version of PHPUnit, but that answer is from 2009, so it's not it. EDIT: I use NetBeans IDE 6.9.1 to run my test.

    Read the article

  • If setUpBeforeClass() fails, test failures are hidden in PHPUnit's JUnit XML output

    - by Adam Monsen
    If setUpBeforeClass() throws an exception, no failures or errors are reported in the PHPUnit's JUnit XML output. Why? Example test class: <?php class Test extends PHPUnit_Framework_TestCase { public static function setUpBeforeClass() { throw new \Exception('masks all failures in xml output'); } public function testFoo() { $this->fail('failing'); } } Command line: phpunit --verbose --log-junit out.xml Test.php Console output: PHPUnit 3.6.10 by Sebastian Bergmann. E Time: 0 seconds, Memory: 3.25Mb There was 1 error: 1) Test Exception: masks all failures in xml output /tmp/pu/Test.php:6 FAILURES! Tests: 0, Assertions: 0, Errors: 1. JUnit XML output: <?xml version="1.0" encoding="UTF-8"?> <testsuites> <testsuite name="Test" file="/tmp/phpunit-broken/Test.php"/> </testsuites> More info: $ php --version PHP 5.3.10-1ubuntu3.1 with Suhosin-Patch (cli) (built: May 4 2012 02:21:57) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans

    Read the article

  • DTracing a PHPUnit Test: Looking at Functional Programming

    - by cj
    Here's a quick example of using DTrace Dynamic Tracing to work out what a PHP code base does. I was reading the article Functional Programming in PHP by Patkos Csaba and wondering how efficient this stype of programming is. I thought this would be a good time to fire up DTrace and see what is going on. Since DTrace is "always available" even in production machines (once PHP is compiled with --enable-dtrace), this was easy to do. I have Oracle Linux with the UEK3 kernel and PHP 5.5 with DTrace static probes enabled, as described in DTrace PHP Using Oracle Linux 'playground' Pre-Built Packages I installed the Functional Programming sample code and Sebastian Bergmann's PHPUnit. Although PHPUnit is included in the Functional Programming example, I found it easier to separately download and use its phar file: cd ~/Desktop wget -O master.zip https://github.com/tutsplus/functional-programming-in-php/archive/master.zip wget https://phar.phpunit.de/phpunit.phar unzip master.zip I created a DTrace D script functree.d: #pragma D option quiet self int indent; BEGIN { topfunc = $1; } php$target:::function-entry /copyinstr(arg0) == topfunc/ { self->follow = 1; } php$target:::function-entry /self->follow/ { self->indent += 2; printf("%*s %s%s%s\n", self->indent, "->", arg3?copyinstr(arg3):"", arg4?copyinstr(arg4):"", copyinstr(arg0)); } php$target:::function-return /self->follow/ { printf("%*s %s%s%s\n", self->indent, "<-", arg3?copyinstr(arg3):"", arg4?copyinstr(arg4):"", copyinstr(arg0)); self->indent -= 2; } php$target:::function-return /copyinstr(arg0) == topfunc/ { self->follow = 0; } This prints a PHP script function call tree starting from a given PHP function name. This name is passed as a parameter to DTrace, and assigned to the variable topfunc when the DTrace script starts. With this D script, choose a PHP function that isn't recursive, or modify the script to set self->follow = 0 only when all calls to that function have unwound. From looking at the sample FunSets.php code and its PHPUnit test driver FunSetsTest.php, I settled on one test function to trace: function testUnionContainsAllElements() { ... } I invoked DTrace to trace function calls invoked by this test with # dtrace -s ./functree.d -c 'php phpunit.phar \ /home/cjones/Desktop/functional-programming-in-php-master/FunSets/Tests/FunSetsTest.php' \ '"testUnionContainsAllElements"' The core of this command is a call to PHP to run PHPUnit on the FunSetsTest.php script. Outside that, DTrace is called and the PID of PHP is passed to the D script $target variable so the probes fire just for this invocation of PHP. Note the quoting around the PHP function name passed to DTrace. The parameter must have double quotes included so DTrace knows it is a string. The output is: PHPUnit 3.7.28 by Sebastian Bergmann. ......-> FunSetsTest::testUnionContainsAllElements -> FunSets::singletonSet <- FunSets::singletonSet -> FunSets::singletonSet <- FunSets::singletonSet -> FunSets::union <- FunSets::union -> FunSets::contains -> FunSets::{closure} -> FunSets::contains -> FunSets::{closure} <- FunSets::{closure} <- FunSets::contains <- FunSets::{closure} <- FunSets::contains -> PHPUnit_Framework_Assert::assertTrue -> PHPUnit_Framework_Assert::isTrue <- PHPUnit_Framework_Assert::isTrue -> PHPUnit_Framework_Assert::assertThat -> PHPUnit_Framework_Constraint::count <- PHPUnit_Framework_Constraint::count -> PHPUnit_Framework_Constraint::evaluate -> PHPUnit_Framework_Constraint_IsTrue::matches <- PHPUnit_Framework_Constraint_IsTrue::matches <- PHPUnit_Framework_Constraint::evaluate <- PHPUnit_Framework_Assert::assertThat <- PHPUnit_Framework_Assert::assertTrue -> FunSets::contains -> FunSets::{closure} -> FunSets::contains -> FunSets::{closure} <- FunSets::{closure} <- FunSets::contains -> FunSets::contains -> FunSets::{closure} <- FunSets::{closure} <- FunSets::contains <- FunSets::{closure} <- FunSets::contains -> PHPUnit_Framework_Assert::assertTrue -> PHPUnit_Framework_Assert::isTrue <- PHPUnit_Framework_Assert::isTrue -> PHPUnit_Framework_Assert::assertThat -> PHPUnit_Framework_Constraint::count <- PHPUnit_Framework_Constraint::count -> PHPUnit_Framework_Constraint::evaluate -> PHPUnit_Framework_Constraint_IsTrue::matches <- PHPUnit_Framework_Constraint_IsTrue::matches <- PHPUnit_Framework_Constraint::evaluate <- PHPUnit_Framework_Assert::assertThat <- PHPUnit_Framework_Assert::assertTrue -> FunSets::contains -> FunSets::{closure} -> FunSets::contains -> FunSets::{closure} <- FunSets::{closure} <- FunSets::contains -> FunSets::contains -> FunSets::{closure} <- FunSets::{closure} <- FunSets::contains <- FunSets::{closure} <- FunSets::contains -> PHPUnit_Framework_Assert::assertFalse -> PHPUnit_Framework_Assert::isFalse -> {closure} -> main <- main <- {closure} <- PHPUnit_Framework_Assert::isFalse -> PHPUnit_Framework_Assert::assertThat -> PHPUnit_Framework_Constraint::count <- PHPUnit_Framework_Constraint::count -> PHPUnit_Framework_Constraint::evaluate -> PHPUnit_Framework_Constraint_IsFalse::matches <- PHPUnit_Framework_Constraint_IsFalse::matches <- PHPUnit_Framework_Constraint::evaluate <- PHPUnit_Framework_Assert::assertThat <- PHPUnit_Framework_Assert::assertFalse <- FunSetsTest::testUnionContainsAllElements ... Time: 1.85 seconds, Memory: 3.75Mb OK (9 tests, 23 assertions) The periods correspond to the successful tests before and after (and from) the test I was tracing. You can see the function entry ("->") and return ("<-") points. Cross checking with the testUnionContainsAllElements() source code confirms the two singletonSet() calls, one union() call, two assertTrue() calls and finally an assertFalse() call. These assertions have a contains() call as a parameter, so contains() is called before the PHPUnit assertion functions are run. You can see contains() being called recursively, and how the closures are invoked. If you want to focus on the application logic and suppress the PHPUnit function trace, you could turn off tracing when assertions are being checked by adding D clauses checking the entry and exit of assertFalse() and assertTrue(). But if you want to see all of PHPUnit's code flow, you can modify the functree.d code that sets and unsets self-follow, and instead change it to toggle the variable in request-startup and request-shutdown probes: php$target:::request-startup { self->follow = 1 } php$target:::request-shutdown { self->follow = 0 } Be prepared for a large amount of output!

    Read the article

1 2 3 4 5 6  | Next Page >