|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the doyo/code-coverage project. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) Anthonius Munthi <[email protected]> |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
declare(strict_types=1); |
|
13
|
|
|
|
|
14
|
|
|
namespace Spec\Doyo\Bridge\CodeCoverage; |
|
15
|
|
|
|
|
16
|
|
|
use Doyo\Bridge\CodeCoverage\Console\ConsoleIO; |
|
17
|
|
|
use Doyo\Bridge\CodeCoverage\Event\CoverageEvent; |
|
18
|
|
|
use Doyo\Bridge\CodeCoverage\ProcessorInterface; |
|
19
|
|
|
use Doyo\Bridge\CodeCoverage\Report; |
|
20
|
|
|
use Doyo\Bridge\CodeCoverage\Report\ReportProcessorInterface; |
|
21
|
|
|
use PhpSpec\ObjectBehavior; |
|
|
|
|
|
|
22
|
|
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
|
|
|
|
|
|
23
|
|
|
|
|
24
|
|
|
class ReportSpec extends ObjectBehavior |
|
25
|
|
|
{ |
|
26
|
|
|
public function it_is_initializable() |
|
27
|
|
|
{ |
|
28
|
|
|
$this->shouldHaveType(Report::class); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
public function it_should_listen_to_coverage_report_event() |
|
32
|
|
|
{ |
|
33
|
|
|
$this->shouldImplement(EventSubscriberInterface::class); |
|
34
|
|
|
$this::getSubscribedEvents()->shouldHaveKeyWithValue(CoverageEvent::report, 'generate'); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
public function its_processor_should_be_mutable( |
|
38
|
|
|
ReportProcessorInterface $processor |
|
39
|
|
|
) { |
|
40
|
|
|
$processor->getType()->shouldBeCalledOnce() |
|
41
|
|
|
->willReturn('type'); |
|
42
|
|
|
|
|
43
|
|
|
$this->getProcessors()->shouldReturn([]); |
|
44
|
|
|
$this->addProcessor($processor); |
|
45
|
|
|
$this->hasProcessor('type')->shouldBe(true); |
|
46
|
|
|
$this->getProcessors()->shouldHaveKeyWithValue('type', $processor); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
public function its_generate_should_create_code_coverage_reports( |
|
50
|
|
|
ReportProcessorInterface $reportSuccess, |
|
51
|
|
|
ConsoleIO $consoleIO, |
|
52
|
|
|
CoverageEvent $coverageEvent, |
|
53
|
|
|
ProcessorInterface $processor |
|
54
|
|
|
) { |
|
55
|
|
|
$coverageEvent |
|
56
|
|
|
->getProcessor() |
|
57
|
|
|
->shouldBeCalledOnce() |
|
|
|
|
|
|
58
|
|
|
->willReturn($processor); |
|
59
|
|
|
$coverageEvent |
|
60
|
|
|
->getConsoleIO() |
|
61
|
|
|
->shouldBeCalledOnce() |
|
|
|
|
|
|
62
|
|
|
->willReturn($consoleIO); |
|
63
|
|
|
|
|
64
|
|
|
$reportSuccess->getType()->willReturn('report-success'); |
|
65
|
|
|
$reportSuccess->getTarget()->willReturn('target'); |
|
66
|
|
|
$reportSuccess |
|
67
|
|
|
->process($processor, $consoleIO) |
|
68
|
|
|
->shouldBeCalledOnce(); |
|
69
|
|
|
|
|
70
|
|
|
$this->addProcessor($reportSuccess); |
|
71
|
|
|
$this->generate($coverageEvent); |
|
72
|
|
|
} |
|
73
|
|
|
} |
|
74
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths