File tree Expand file tree Collapse file tree 4 files changed +23
-5
lines changed
tests/Codacy/Coverage/Parser Expand file tree Collapse file tree 4 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 11language : php
22
33php :
4- - ' 7.0.17'
54 - ' 7.0'
6- - ' 7.1.2'
5+ - ' 7.1'
6+ - ' 7.2'
77 - nightly
88
99before_script :
1010# 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
1312
1413# Explicitly use the phpunit from composer, not any system-wide found
15- script :
14+ script :
1615 - php vendor/bin/phpunit --coverage-clover build/coverage/xml tests
1716
1817after_success :
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ class CloverParserTest extends \PHPUnit\Framework\TestCase
88 public function testThrowsExceptionOnWrongPath ()
99 {
1010 $ 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" ' );
1112 new CloverParser ("/home/foo/bar/baz/m.xml " );
1213 }
1314
Original file line number Diff line number Diff line change @@ -31,4 +31,14 @@ public function testParsersProduceSameResult()
3131
3232 $ this ->assertJsonStringEqualsJsonString ($ expectedJson , $ xunitJson );
3333 }
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+ }
3444}
Original file line number Diff line number Diff line change @@ -12,6 +12,14 @@ public function testThrowsExceptionOnWrongPath()
1212 new PhpUnitXmlParser ("/home/foo/bar/baz/fake.xml " );
1313 }
1414
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+
1523 /**
1624 * Testing against the clover coverage report 'tests/res/clover/clover.xml'
1725 * 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