Skip to content

Commit 332ef93

Browse files
committed
Make clover report the suggested one
1 parent 83b7905 commit 332ef93

File tree

8 files changed

+14
-15
lines changed

8 files changed

+14
-15
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ before_script:
1313

1414
# Explicitly use the phpunit from composer, not any system-wide found
1515
script:
16-
- vendor/bin/phpunit tests
17-
# newer versions of phpunit allow this configuration: -c phpunit.xml --coverage-clover=coverage.xml tests
16+
- php vendor/bin/phpunit --coverage-clover build/coverage/xml tests
1817

1918
after_success:
20-
- php vendor/bin/codacycoverage clover
19+
- php vendor/bin/codacycoverage clover build/coverage/xml

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- PHP 5.3 or later
1212
- One of the following coverage report formats
1313
- Clover XML (e.g. ```--coverage-clover``` in PHPUnit)
14-
- PHPUnit XML (e.g. ```--coverage-xml``` in PHPUnit)
14+
- [Only for PHPUnit <4] PHPUnit XML (e.g. ```--coverage-xml``` in PHPUnit)
1515

1616
# Installation
1717

@@ -124,10 +124,10 @@ before_script:
124124
- php composer.phar install -n
125125

126126
script:
127-
- php vendor/bin/phpunit
127+
- php vendor/bin/phpunit --coverage-clover build/coverage/xml
128128

129129
after_script:
130-
- php vendor/bin/codacycoverage clover path/to/clover.xml
130+
- php vendor/bin/codacycoverage clover build/coverage/xml
131131
```
132132
133133
## Troubleshooting

circle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ dependencies:
99

1010
test:
1111
post:
12-
- php vendor/bin/phpunit
13-
- php bin/codacycoverage clover
12+
- php vendor/bin/phpunit --coverage-clover build/coverage/xml tests
13+
- php bin/codacycoverage clover build/coverage/xml

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"symfony/console": "~2.5|~3.0"
1010
},
1111
"require-dev": {
12-
"phpunit/phpunit": "~4.5"
12+
"phpunit/phpunit": "~6.5"
1313
},
1414
"bin": ["bin/codacycoverage"],
1515
"autoload": {

tests/Codacy/Coverage/Parser/CloverParserTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
use Codacy\Coverage\Parser\CloverParser;
44

5-
class CloverParserTest extends PHPUnit_Framework_TestCase
5+
class CloverParserTest extends \PHPUnit\Framework\TestCase
66
{
77

88
public function testThrowsExceptionOnWrongPath()
99
{
10-
$this->setExpectedException('InvalidArgumentException');
10+
$this->expectException('InvalidArgumentException');
1111
new CloverParser("/home/foo/bar/baz/m.xml");
1212
}
1313

tests/Codacy/Coverage/Parser/ParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use Codacy\Coverage\Util\JsonProducer;
77

8-
class ParserTest extends \PHPUnit_Framework_TestCase
8+
class ParserTest extends \PHPUnit\Framework\TestCase
99
{
1010
/**
1111
* Running against tests/res/phpunit-clover

tests/Codacy/Coverage/Parser/PhpUnitXmlParserTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
use Codacy\Coverage\Parser\PhpUnitXmlParser;
44

5-
class PhpUnitXmlParserTest extends PHPUnit_Framework_TestCase
5+
class PhpUnitXmlParserTest extends \PHPUnit\Framework\TestCase
66
{
77

88

99
public function testThrowsExceptionOnWrongPath()
1010
{
11-
$this->setExpectedException('InvalidArgumentException');
11+
$this->expectException('InvalidArgumentException');
1212
new PhpUnitXmlParser("/home/foo/bar/baz/fake.xml");
1313
}
1414

tests/Codacy/Coverage/Util/GitClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use Codacy\Coverage\Util\GitClient;
44

5-
class GitClientTest extends PHPUnit_Framework_TestCase
5+
class GitClientTest extends \PHPUnit\Framework\TestCase
66
{
77
public function testGetHashOfLastCommit()
88
{

0 commit comments

Comments
 (0)