1
vote
1answer
37 views

PHP - Code coverage - cannot get some lines covered… (Netbeans)

In my NetBeans I have set up a project (ZF2 app) with PHPUnit. Everything is fine except when I try to collect the code coverage, it fails to cover certain lines, which I do not understand nor can ...
1
vote
2answers
64 views

Stop phing deployment if code coverage is below 85%

Am using a phing to deploy my php code but we need to add a condition to stop the deployment if any of the PHP Unit test cases fails or code coverage is less than 85% We were able to add the PHP Unit ...
0
votes
1answer
12 views

Code coverage for phpunit

1) I used the selenium with phpunit ,I tried to used the code coverage for phpunit but I have one doubt.Is this code coverage is used for only unit test (or) functional test 2) If i used code coverage ...
0
votes
0answers
16 views

Issue with installing phpunit (CodeCoverage)

I have a problem with upgrading my phpunit version. i can upgrade dependencies (file_iterator, text_template ...etc) But, when i tried to install PHP_CodeCoverage, i got this message : Failed to ...
0
votes
0answers
32 views

namespaced code not included in coverage

here is phpunit.xml : <phpunit bootstrap="bootstrap.php" colors="false" convertErrorsToExceptions="true" convertNoticesToExceptions="true" ...
0
votes
1answer
25 views

Exclude a pattern from code coverage?

As far as I understand one can exclude files and directories from code coverage by name but is it possible to exclude by matching a pattern ? I ask this because I don't want to mention the path to ...
0
votes
1answer
70 views

Is there a way to have PHPUnit determine code coverage for @method declarations?

I have a number of methods being declared in a class with the standard phpdoc @method syntax, for example: /** * @method string magicMethod(int $arg1, array $arg2) Method description. */ class ... ...
0
votes
0answers
14 views

code coverage tools for QA to get coverage of a php website? [duplicate]

It seems most of the CC tools are for unit test, But as an QA, I need to test a php website and I want to know how much I've tested. That's mean, I do some test through my browser, and can get the ...
0
votes
0answers
95 views

Can I teach PHPUnit that Mage::throwException *always* throws an exception?

Magento has a static method that does some extra reporting just before throwing an exception. /** * Throw Exception * * @param string $message * @param string $messageStorage * @throws ...
0
votes
1answer
87 views

0% Classes code coverage in phpunit/xdebug

I'm using PHPUnit/Xdebug for running unit tests and although my Methods and Lines coverage percentile is in the 90s, Classes always reads as 0%. How is the classes coverage determined and is there ...
0
votes
1answer
109 views

PHPUnit and PHP_CodeCoverage: Enable PHP_CodeCoverage for entire code base

All of my code base is in one folder and it's sub-directories, all of my tests are in another folder and it's sub-directories. When I run PHPUnit, I point it to the test folder, and all Files in my ...
0
votes
1answer
219 views

PHPUnit --no-coverage option to overwrite config file

I use PHPUnit to test my projects, using a phpunit.xml.dist config file. The default configuration for all my projects is set to generate html code coverage reports. Is there anyway I can run the ...
2
votes
0answers
96 views

PHPUnit - Remote Code Coverage

I have a full REST project. Test cases call the REST APIc through cURL. How can I add this request to code coverage report? I know that PHPUnit-Selenium can collect code coverage report through ...
1
vote
0answers
197 views

PHPUnit code coverage report in Clover XML format contains interfaces

I use the @codeCoverageIgnore annotation in order to ignore interfaces in code coverage reports. Some time ago I have used code coverage report in HTML format and I have not found any issues while I ...
0
votes
1answer
128 views

PHPUnit - how to ignore code coverage for classloader?

When I generate code coverage for my PHP project, I always get the Symfony autoloader. I tried adding this to my PHPUnit config with no luck: <filter> <blacklist> ...
0
votes
1answer
40 views

Phpunit Code Coverage - 0 Files Analysed when including File with Function in it in Test

I am getting a weird result when trying to create a code coverage report of my test. I call this: phpunit --coverage-html report tests/JSONTest.php And get this: PHPUnit 3.6.12 by Sebastian ...
9
votes
1answer
297 views

yii phpunit testing with views in coverage

My Yii app getting phpunit coverage in controllers, models, components, modules but not any views. The problem is that code coverage loader in phpunit includes the view file during preparing a ...
0
votes
1answer
95 views

Generating report from xdebug_get_code_coverage output

We are using BDDs to test our code. With BDDs you basically have two sets of code, one that runs the tests and the second that is actually executing on your server. As far as I can tell most of code ...
0
votes
1answer
250 views

PHPUnit Selenium RC test coverage works for GET but not POST requests?

I've inherited a Zend Framework web application that is neither object-oriented nor well-written in many respects, and it came with zero tests. So while I appreciate the value of unit tests, and will ...
0
votes
2answers
251 views

visual code coverage in travis-ci

I've got some github projects which I want to test with code coverage. The only way I found (see blog post) to achieve this is to write a custom script that counts code coverage XML lines and outputs ...
0
votes
0answers
103 views

Abstract methods not showing up as covered in coverage report

I have an abstract class containing a abstract method abstract class AbstractImporter { abstract protected function runImporter(); } An implementation class SomeImporter extends ...
0
votes
1answer
476 views

PHPUnit coverage-html analyzes the wrong folders

I'm learning Zend Framework 2 after the ZF2 "Getting Started" tutorial. Now I have a simple application a PHPUnit test of the IndexController (the code is copied from the capitel "Unit Testing" of the ...
0
votes
2answers
1k views

PHPUnit code coverage gives zend_mm_heap corrupted or segmentation fault 11

I'm working on a Symfony2 bundle and ran phpunit --coverage-text. All tests pass without any problems and I received a code coverage report, but it was incomplete and at the bottom there is the ...
2
votes
1answer
841 views

Force Exclude files from PHPUnit Code Coverage

Is it possible to forcefully exclude a folder from PHPUnit's code coverage? Problem I've got is, that I have a Symfony 1.4 project, which has folders at ./lib/vendor/symfony/*. I want to exclude ...
1
vote
3answers
387 views

Cannot redeclare class error with CodeCoverage and Composer

I'm getting an error with PHPUnit Code_Coverage when using Composer's autoload.php as the bootstrap file. I've created my own boostrap.php file and simply include each file individually and everything ...
3
votes
3answers
1k views

PHP_CodeCoverage_Filter::getInstance() Error running phpunit

I have installed phpunit in my ubuntu 11.10 having php version 5.2.14. But when I run my test module it is throwing error, PHP Fatal error: Call to undefined method ...
5
votes
2answers
96 views

How to test statements which depends on specific PHP version with PHPUnit?

I have a construct like this: class Foo { public function doFoo($value = '') { if (function_exists('foo')) { return foo($value); } // if php ...
6
votes
1answer
641 views

Exclude base directory from PHPUnit Code Coverage

How do I exclude the base directories from PHPUnit's Code Coverage? This is my phpunit.xml <?xml version="1.0" encoding="UTF-8"?> <phpunit bootstrap="include.php" ...
1
vote
2answers
195 views

PHPUnit Code Coverage of abstract class implementing an interface

I'm currently working on Bitcoin Payment Bundle for Symfony2. You can view it on my github. It is not (yet, I hope) fully test-driven developed but I try to make it as test-covered as possible. ...
0
votes
1answer
194 views

CodeCoverage with PHPunit not generating

PHPunit 3.7.1 PHP 5.3.14 Windows 7 Using cmd I "cd" into the dir where phpunit.xml lives and run phpunit -c phpunit.xml but that dosen't generate any code coverage. phpunit.xml: <phpunit ...
4
votes
1answer
312 views

phpunit merge two or more clover.xml reports

I have several clover.xml reports of different extensions of a projects. I want to combine them into one clover.xml and then create it into a clover html. But i see no way with the phpunit classes ...
0
votes
1answer
786 views

why phpUnit test code coverage not working in Symfony2 when including file?

PHP Fatal error: Class 'Symfony\Bundle\FrameworkBundle\Test\WebTestCase' not found in /home/manivasagam/projects/ProofCentral/src/ProofCentral/ServiceBundle/Tests/Services/AttachmentServiceTest.php ...
1
vote
1answer
87 views

Generate new code coverage for a single file without clearing all other coverage reports in PHPUnit

First the question: In PHPUnit 3.5, is there a way to generate a coverage report for a single test without the report for the entire test suite being overwritten. I.e. only update the coverage report ...
1
vote
1answer
623 views

PHPUnit - Trying to @cover not existing method

My test case looks like this: class FooTest extends PHPUnit_Framework_TestCase { /** @covers MyClass::bar */ function testBar() { $result = MyClass::bar(); ...
3
votes
1answer
418 views

Is it possible to run HTML test suite from PHPUnit?

I want to measure code coverage of an HTML test suite for selenium. Therefore I want to use PHPUnit in order to execute the suite, because PHPUnit has nice support for code coverage analysis. ...
0
votes
1answer
336 views

PHPUnit, Code Coverage, xdebug and html reports

Well, I have a problem trying to setup code coverage reports. First thing I had to do was to install xdebug, I did it, and it worked...Well, actually, instead of showing me the coverage of my test ...
1
vote
2answers
449 views

PHPUnit code coverage for class that extends abstract class

I have an abstract class Exception in custom namespace which has no abstract methods. All methods are shown as covered by its tests (mocked in a standard way). The reason to make it abstract is ...
3
votes
2answers
119 views

How to cover Exception Classes in PHPUnit

Im aiming for very high code coverage and want to either cover exception classes or have them excluded from the codecoverage reports. Example code class My_DataException extends Exception {} class ...
1
vote
1answer
356 views

0% code coverage with PHPUnit

I'm running module tests with PHPUnit and want to get coverage reports on the tests. I've successfully been doing this in the past, but somehow i cannot get it working again and I have no idea why ...
2
votes
2answers
295 views

PHPUnit code coverage all test files plus another directory

We are struggling to get desired results from the coverage report using phpunit. Previously, we were only capturing code coverage for files that had unit tests associated with them (I believe this is ...
1
vote
1answer
61 views

How do I map code coverage reports to a diff file?

I have code coverage running from PhpUnit, and I can generate a diff file in Git that will show me what's about to be released. How would I go about mapping one to the other, so that I can say the ...
2
votes
1answer
1k views

Resolved - How can PHPUnit code coverage ignore my autoloader?

I have a bootstrap in my phpunit config that runs the Zend\Loader\StandardAutoloader.php. I can get PHPUnit code coverage to ignore it when I add <filter> <blacklist> ...
3
votes
2answers
662 views

Does PHPUnit_Selenium Code Coverage Work?

In the PHPUnit docs, it says that it's possible to get code coverage data: PHPUnit_Extensions_SeleniumTestCase can collect code coverage information for tests run through Selenium: Copy ...
3
votes
1answer
184 views

PHPUnit code coverage reports SOME files as they have no code in it (and so report a 0/0 Line 100% coverage)

I've been searching a solution for a while but couldn't find any. I do some code-coverage on my PHP application and it works fine except for a couple of files that PHPUnit seems to consider as empty ...
0
votes
1answer
88 views

PHPUnit codecoverage halts without reporting any error

When executing PHPUnit with codecoverage, the coverage generating just halts without any error, and no report is generated. The problem is caused by a fatal error in one file, but it's hard to find ...
1
vote
0answers
151 views

Code Coverage under PHPUnit for admin areas

I'm trying to get PHPUnit and CodeCoverage over a few hundred PHP code repositories. A consistent problem I receive is that CodeCoverage doesn't work over any of my Admin pages that have session_start ...
0
votes
2answers
660 views

IntelliJ Ultimate/PhpStorm, showing code coverage results for Symfony2 project

I'm using IntelliJ Ultimate 11.1 which includes the goodies that comes with the latest PhpStorm. I'm trying to get some things working with the new Code Coverage feature, but having a bit of trouble ...
2
votes
1answer
1k views

Clover PHPUnit coverage report is including coverage for unwanted file

I have just set up CloverPHP into my Jenkins job. I am using PHPUnit to generate the clover report and it seems to all be working apart from the coverage report which is showing the file ...
3
votes
1answer
2k views

PHPUnit Code Coverage

I am learning the ropes with Unit testing Zend Framework applications. So far I have set up PHPUnit to work with Zend Framework and have started writing some simple Test Cases. My issue is that I am ...
8
votes
1answer
1k views

How to adjust Jenkins weather report for clover coverage on PHP projects

I have a few PHP projects installed for a new team in Jenkins, and I'm trying to lower the expectations initially to help ramp them up on testing and everything. Initially we're shooting for 20% code ...

15 30 50 per page