Paladin
Paladin

Reputation: 1637

How to phpUnit-cover continue, break,

Simple question, how do i cover lines with continue, break, ... with phpUnit and xDebug? System is set up and running, code coverage is generated, all well, but some lines with continue, break and so on are marked as "not covered", so method is marked "not covered", so class is ... you know what.

Example:

if ($taskData['srcType']=='c') {
    continue;
}

The Line 'continue;' is marked "not covered.

System: Win7, xDebug 2.2.3, phpUnit 3.7.27

Upvotes: 0

Views: 365

Answers (1)

Sven
Sven

Reputation: 70853

Well, a nasty solution could be to exclude those lines from the code coverage statistics.

Add @codeCoverageIgnoreStart and @codeCoverageIgnoreEnd around that line.

http://phpunit.de/manual/3.8/en/code-coverage-analysis.html#code-coverage-analysis.ignoring-code-blocks

Upvotes: 1

Related Questions