phpunit

PHPUnit_Framework_Exception: Could not connect to the Selenium RC server when I run with Hudson

自闭症网瘾萝莉.ら 提交于 2019-12-13 03:58:29
问题 I have set up Hudson CI Server and running PHPUnit test with Selenium (big thanks to this post!). Now I am running Hudson server and Selenium server on my localhost. I set up Hudson as port 8080 (default) and Selenium -port 1234 as it conflicts otherwise. However, every time I run Selenium test, I get a following error: PHPUnit_Framework_Exception: Could not connect to the Selenium RC server. /Users/***/.hudson/jobs/Selenium/workspace/sampleTest.php:28 /usr/lib/php/phing.php:37 where line 28

PHPUnit_Framework_Exception when trying to run Codeception / Selenium with Internet Explorer 11 / IE11

落花浮王杯 提交于 2019-12-13 02:56:44
问题 When I try to run my Codeception tests with Internet Explorer 11, I get the following error: [PHPUnit_Framework_Exception] Undefined index: ELEMENT 回答1: This problem was resolved by re-starting Selenium with a passthru flag. java -jar selenium-server-standalone-3.5.3.jar -enablePassThrough false 来源: https://stackoverflow.com/questions/48799845/phpunit-framework-exception-when-trying-to-run-codeception-selenium-with-inter

Running PHPUnit on command line errors out

♀尐吖头ヾ 提交于 2019-12-13 02:56:38
问题 I run this on the command line: phpunit --version I get the following errors: PHP Warning: require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in /usr/lib/php/pear/PHPUnit/Autoload.php on line 45 PHP Fatal error: require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.:/Users/dennismonsewicz/pear/share/pear:/usr/local/share/pear:/usr/lib/php/pear/PHPUnit') in /usr/lib/php/pear/PHPUnit/Autoload.php on line 45 Anyone else run

Simple check of PHPUnit result

主宰稳场 提交于 2019-12-13 02:35:14
问题 I want to to glue PHPUnit with other command tools and I need a simple way to check if the tests passed or failed. Somethings like phpunit path_to_folder_containing_the_test Would return "ok" if all passed or "failed" if any test failed. [So I can simply check for "ok" and "failed" values from other tools] 回答1: I have a very simply shell script that capture the exit code like: >phpunit TestOk.php >echo $? 0 and >phpunit TestKo.php >echo $? 1 Hope this help 回答2: In your batch file, look for

Laravel: Lacking mcrypt extension only when using phpunit

微笑、不失礼 提交于 2019-12-12 23:01:54
问题 I have a following problem - when using phpunit in my Laravel 4 installation folder I get a following error: Laravel requires the Mcrypt PHP extension. However it does not appear when I'm using the artisan command. I know that the issue must be caused by phpunit loading another php.ini than the one set in my zshconfig. Unfortunately I don't know how to force phpunit to use the correct one. My .zshconfig looks like this: # Customize to your needs... export PATH=:/Applications/MAMP/Library/bin/

build should fail if code coverage Report Percenatge is less

Deadly 提交于 2019-12-12 20:32:26
问题 I have written a build.xml for generating Reports through phing. I have added below command in build.xml to generate code coverage Report :: <exec command="phpunit --coverage-html ./code_Coverage_Report codecoverage_test/CodeCoverage.php "/> Now i wanted to add a check in build.xml that if my code coverage Report percentage is less than 85% then the build should automatically fail. 回答1: This is not possible with PHPUnit. There was a pull request to implement what you want, but it was rejected

How to configure PhpUnit in Xampp?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 19:42:26
问题 I have successfully installed PhpUnit in Xampp, now I need to configure it, i need to take this steps from the documentation: 2. Prepare the phpunit script: 1. Rename the phpunit.php script to phpunit. 2. Replace the @php_bin@ string in it with the path to your PHP command-line interpreter (usually /usr/bin/php). 3. Copy it to a directory that is in your path and make it executable (chmod +x phpunit). 3. Prepare the PHPUnit/Util/PHP.php script: 1. Replace the @php_bin@ string in it with the

symfony2 and phpunit does not work on lampp (ubuntu 15.x)

会有一股神秘感。 提交于 2019-12-12 19:27:08
问题 My symfony2 application is working with phpunit perfectly on wamp (windows) but when a change the environment and start to work on lampp (linux) after installing, I get the following error when run the test by typing phpunit -c app/: `/opt/lampp/htdocs/VTALLY/src/Iballot/CmsBundle/Tests/Controller/ParliamentaryControllerTest.php:11 Caused by Symfony\Component\Yaml\Exception\ParseException: The reserved indicator "@" cannot start a plain scalar; you need to quote the scalar at line 4 (near

Eloquent Query Scope return Builder instead of Model when using phpunit

时光怂恿深爱的人放手 提交于 2019-12-12 19:21:10
问题 I have the following code $user = User::findByAccountCode($transaction->account_code); When I execute this code on phpunit it returns an instance of Illuminate\Database\Eloquent\Builder instead of User Model. Here is the code for findByAccountCode public function scopeFindByAccountCode($query,$account_code){ return $query->where('account_code', $account_code)->first(); } I get the following error on my Application ErrorException: Argument 1 passed to aunicaj\Libraries\MarkupRepository::user()

PHPUnit doesn't allow me to include files

梦想的初衷 提交于 2019-12-12 18:39:43
问题 PHPUnit is giving me an error message whenever I try to include a file. For example the follwing code gives me the error: <?php include_once "PHPUnit/Autoload.php"; require_once "controller/ProductController.php"; class SecurityTests extends PHPUnit_Framework_TestCase { public function testSmth() { $this->assertTrue(1==1); } } ?> But if I remove the fourth line ( require_once "controller/ProductController.php"; ), it runs fine. The error I get is: Warning: require_once(PHPUnit/Framework/Error