File: PHPUnitEnricherTest.php

package info (click to toggle)
phpdox 0.8.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,376 kB
  • ctags: 2,505
  • sloc: xml: 51,137; php: 8,771; makefile: 19
file content (32 lines) | stat: -rw-r--r-- 1,075 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
use TheSeer\phpDox\Generator\Enricher;
use TheSeer\phpDox\Generator\Enricher\PHPUnitConfig;

class PHPUnitEnricherTest extends \PHPUnit_Framework_TestCase {


    public function testCoverageInformationIsImportedProperly() {

        $config = $this->getMockBuilder(PHPUnitConfig::class)
                    ->disableOriginalConstructor()
                    ->getMock();
        $config->expects($this->once())
               ->method('getCoveragePath')
               ->will($this->returnValue(__DIR__ . '/coverage'));

        $enricher = new Enricher\PHPUnit($config);

        $stub = new TheSeer\fDOM\fDOMDocument();
        $stub->preserveWhiteSpace = false;
        $stub->load(__DIR__ . '/xml/classes/Api_Helper_SummaryFactory.xml');
        $stub->registerNamespace('phpdox', 'http://xml.phpdox.net/src');

        $event = new \TheSeer\phpDox\Generator\ClassStartEvent(
            new \TheSeer\phpDox\Generator\ClassObject($stub)
        );
        $enricher->enrichClass($event);

        $stub->formatOutput = true;
        echo $stub->saveXML();
    }
}