Test Failed
Pull Request — master (#132)
by Alessandro
03:15
created

CloverTest::testWriteToFile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 15
Ratio 100 %

Importance

Changes 0
Metric Value
dl 15
loc 15
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tests\Unit\Coverage\Processor;
6
7
use Paraunit\Configuration\OutputFile;
8
use Paraunit\Coverage\Processor\Clover;
9
use Tests\BaseUnitTestCase;
10
11
/**
12
 * Class CloverTest
13
 * @package Tests\Unit\Proxy
14
 */
15 View Code Duplication
class CloverTest extends BaseUnitTestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
16
{
17
    public function testWriteToFile()
18
    {
19
        $targetFile = new OutputFile(sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'clover.xml');
20
        $text = new Clover($targetFile);
21
22
        $this->assertFileNotExists($targetFile->getFilePath());
23
24
        $text->process($this->createCodeCoverage());
25
26
        $content = $this->getFileContent($targetFile->getFilePath());
27
        unlink($targetFile->getFilePath());
28
        $this->assertStringStartsWith('<?xml', $content);
29
        $this->assertContains('<coverage generated=', $content);
30
        $this->assertContains('</coverage>', $content);
31
    }
32
}
33