This repository was archived by the owner on Feb 19, 2020. It is now read-only.
File tree 4 files changed +23
-5
lines changed
tests/Codacy/Coverage/Parser
4 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 1
1
language : php
2
2
3
3
php :
4
- - ' 7.0.17'
5
4
- ' 7.0'
6
- - ' 7.1.2'
5
+ - ' 7.1'
6
+ - ' 7.2'
7
7
- nightly
8
8
9
9
before_script :
10
10
# In case of timeouts and build failures you may want to prepend 'travis_retry' to the following commands:
11
- - curl -s http://getcomposer.org/installer | php
12
- - php composer.phar install -n
11
+ - composer install -n
13
12
14
13
# Explicitly use the phpunit from composer, not any system-wide found
15
- script :
14
+ script :
16
15
- php vendor/bin/phpunit --coverage-clover build/coverage/xml tests
17
16
18
17
after_success :
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ class CloverParserTest extends \PHPUnit\Framework\TestCase
8
8
public function testThrowsExceptionOnWrongPath ()
9
9
{
10
10
$ this ->expectException ('InvalidArgumentException ' );
11
+ $ this ->expectExceptionMessage ('Unable to load the xml file. Make sure path is properly set. Using: "/home/foo/bar/baz/m.xml" ' );
11
12
new CloverParser ("/home/foo/bar/baz/m.xml " );
12
13
}
13
14
Original file line number Diff line number Diff line change @@ -31,4 +31,14 @@ public function testParsersProduceSameResult()
31
31
32
32
$ this ->assertJsonStringEqualsJsonString ($ expectedJson , $ xunitJson );
33
33
}
34
+
35
+ public function testConstructorOnNullRootDir ()
36
+ {
37
+ $ parser = new PhpUnitXmlParser ('tests/res/phpunitxml/index.xml ' );
38
+ $ parser ->setDirOfFileXmls ("tests/res/phpunitxml " );
39
+ $ report = $ parser ->makeReport ();
40
+
41
+ $ this ->assertEquals (69 , $ report ->getTotal ());
42
+ $ this ->assertEquals (10 , sizeof ($ report ->getFileReports ()));
43
+ }
34
44
}
Original file line number Diff line number Diff line change @@ -12,6 +12,14 @@ public function testThrowsExceptionOnWrongPath()
12
12
new PhpUnitXmlParser ("/home/foo/bar/baz/fake.xml " );
13
13
}
14
14
15
+ public function testMakeReportThrowsExceptionOnWrndPath ()
16
+ {
17
+ $ parser = new PhpUnitXmlParser ('tests/res/phpunitxml/index.xml ' , '/home/jacke/Desktop/codacy-php ' );
18
+
19
+ $ this ->expectException ('InvalidArgumentException ' );
20
+ $ parser ->makeReport ();
21
+ }
22
+
15
23
/**
16
24
* Testing against the clover coverage report 'tests/res/clover/clover.xml'
17
25
* The test had been made in /home/jacke/Desktop/codacy-php so we need to pass this
You can’t perform that action at this time.
0 commit comments