mirror of
https://github.com/Dannecron/coverage-merger.git
synced 2025-12-26 00:02:35 +03:00
add tests
This commit is contained in:
3
tests/data/.gitignore
vendored
Normal file
3
tests/data/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*
|
||||
!examples/
|
||||
!.gitignore
|
||||
8
tests/data/examples/empty-file-with-package.xml
Normal file
8
tests/data/examples/empty-file-with-package.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage>
|
||||
<project>
|
||||
<package name="test">
|
||||
<file name="test.php"/>
|
||||
</package>
|
||||
</project>
|
||||
</coverage>
|
||||
7
tests/data/examples/empty-file-without-package.xml
Normal file
7
tests/data/examples/empty-file-without-package.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage>
|
||||
<project>
|
||||
<file name="test.php"/>
|
||||
<file name="other.php"/>
|
||||
</project>
|
||||
</coverage>
|
||||
6
tests/data/examples/empty-package.xml
Normal file
6
tests/data/examples/empty-package.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage>
|
||||
<project>
|
||||
<package name="test"/>
|
||||
</project>
|
||||
</coverage>
|
||||
4
tests/data/examples/empty-project.xml
Normal file
4
tests/data/examples/empty-project.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage>
|
||||
<project/>
|
||||
</coverage>
|
||||
14
tests/data/examples/file-with-bad-line.xml
Normal file
14
tests/data/examples/file-with-bad-line.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage>
|
||||
<project>
|
||||
<package name="test">
|
||||
<file name="test.php">
|
||||
<line num="1" type="method" name="__construct" visibility="public" complexity="1" crap="2.00" count="0"/>
|
||||
<line num="2" type="stmt" />
|
||||
<line num="3" type="stmt" count="2"/>
|
||||
<line num="4" type="stmt" count="3"/>
|
||||
<line num="5" type="stmt" count="4"/>
|
||||
</file>
|
||||
</package>
|
||||
</project>
|
||||
</coverage>
|
||||
16
tests/data/examples/file-with-differences.xml
Normal file
16
tests/data/examples/file-with-differences.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage>
|
||||
<project>
|
||||
<package name="test">
|
||||
<file name="test.php">
|
||||
<line num="2" type="stmt" count="1"/>
|
||||
<line num="4" type="stmt" count="3"/>
|
||||
<line num="6" type="stmt" count="1"/>
|
||||
<line num="8" type="stmt" count="3"/>
|
||||
</file>
|
||||
<file name="other.php">
|
||||
<line num="1" type="stmt" count="1"/>
|
||||
</file>
|
||||
</package>
|
||||
</project>
|
||||
</coverage>
|
||||
10
tests/data/examples/file-with-errors.xml
Normal file
10
tests/data/examples/file-with-errors.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage>
|
||||
<project>
|
||||
<package/>
|
||||
<package>
|
||||
<file/>
|
||||
<bogus/>
|
||||
</package>
|
||||
</project>
|
||||
</coverage>
|
||||
22
tests/data/examples/file-with-junk.xml
Normal file
22
tests/data/examples/file-with-junk.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage>
|
||||
<bogus/>
|
||||
<project>
|
||||
<dinosaurs>
|
||||
<dinosaur name="Tyrannosaurus"/>
|
||||
<dinosaur name="Velociraptor"/>
|
||||
<dinosaur name="Spinosaurus"/>
|
||||
</dinosaurs>
|
||||
<package name="test">
|
||||
<folder name="test folder"/>
|
||||
<file name="test.php">
|
||||
<line num="1" type="method" name="__construct" visibility="public" complexity="1" crap="2.00" count="0"/>
|
||||
<line num="2" type="stmt" count="1"/>
|
||||
<line num="3" type="stmt" count="2"/>
|
||||
<line num="4" type="stmt" count="3"/>
|
||||
<line num="5" type="stmt" count="4"/>
|
||||
</file>
|
||||
</package>
|
||||
</project>
|
||||
<project/>
|
||||
</coverage>
|
||||
6
tests/data/examples/file-with-no-name.xml
Normal file
6
tests/data/examples/file-with-no-name.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage>
|
||||
<project>
|
||||
<file/>
|
||||
</project>
|
||||
</coverage>
|
||||
14
tests/data/examples/file-with-package.xml
Normal file
14
tests/data/examples/file-with-package.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage>
|
||||
<project>
|
||||
<package name="test">
|
||||
<file name="test.php">
|
||||
<line num="1" type="method" name="__construct" visibility="public" complexity="1" crap="2.00" count="0"/>
|
||||
<line num="2" type="stmt" count="1"/>
|
||||
<line num="3" type="stmt" count="2"/>
|
||||
<line num="4" type="stmt" count="3"/>
|
||||
<line num="5" type="stmt" count="4"/>
|
||||
</file>
|
||||
</package>
|
||||
</project>
|
||||
</coverage>
|
||||
12
tests/data/examples/file-without-package.xml
Normal file
12
tests/data/examples/file-without-package.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage>
|
||||
<project>
|
||||
<file name="test.php">
|
||||
<line num="1" type="method" name="__construct" visibility="public" complexity="1" crap="2.00" count="0"/>
|
||||
<line num="2" type="stmt" count="1"/>
|
||||
<line num="3" type="stmt" count="2"/>
|
||||
<line num="4" type="stmt" count="3"/>
|
||||
</file>
|
||||
<metrics loc="719" ncloc="578" statements="141" coveredstatements="138"/>
|
||||
</project>
|
||||
</coverage>
|
||||
30
tests/data/examples/metrics-and-classes.xml
Normal file
30
tests/data/examples/metrics-and-classes.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage generated="1537585816">
|
||||
<project timestamp="1537585816">
|
||||
<package name="Example\Namespace">
|
||||
<file name="/src/Example/Namespace/Class.php">
|
||||
<class name="Example\Namespace\Class" namespace="Example\Namespace">
|
||||
<metrics complexity="7" methods="1" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="15" coveredstatements="9" elements="16" coveredelements="9"/>
|
||||
</class>
|
||||
<line num="22" type="method" name="__construct" visibility="public" complexity="7" crap="10.14" count="1"/>
|
||||
<line num="28" type="stmt" count="1"/>
|
||||
<line num="29" type="stmt" count="0"/>
|
||||
<line num="31" type="stmt" count="0"/>
|
||||
<line num="32" type="stmt" count="0"/>
|
||||
<line num="35" type="stmt" count="1"/>
|
||||
<line num="36" type="stmt" count="0"/>
|
||||
<line num="37" type="stmt" count="1"/>
|
||||
<line num="38" type="stmt" count="0"/>
|
||||
<line num="39" type="stmt" count="1"/>
|
||||
<line num="40" type="stmt" count="0"/>
|
||||
<line num="43" type="stmt" count="1"/>
|
||||
<line num="44" type="stmt" count="1"/>
|
||||
<line num="45" type="stmt" count="1"/>
|
||||
<line num="49" type="stmt" count="1"/>
|
||||
<line num="50" type="stmt" count="1"/>
|
||||
<metrics loc="51" ncloc="37" classes="1" methods="1" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="15" coveredstatements="9" elements="16" coveredelements="9"/>
|
||||
</file>
|
||||
</package>
|
||||
<metrics loc="719" ncloc="578" statements="141" coveredstatements="138"/>
|
||||
</project>
|
||||
</coverage>
|
||||
2
tests/data/examples/minimal.xml
Normal file
2
tests/data/examples/minimal.xml
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage/>
|
||||
4
tests/data/examples/non-clover.xml
Normal file
4
tests/data/examples/non-clover.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<card>
|
||||
<name>John Doe</name>
|
||||
<title>CEO, Widget Inc.</title>
|
||||
</card>
|
||||
Reference in New Issue
Block a user