Failed Conditions
Pull Request — master (#3)
by Jonathan
01:51
created

ConsoleTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 31
dl 0
loc 51
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testExecute() 0 49 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace UsageFinder\Tests;
6
7
use PHPUnit\Framework\TestCase;
8
use Symfony\Component\Process\Process;
9
10
final class ConsoleTest extends TestCase
11
{
12
    public function testExecute() : void
13
    {
14
        $process = new Process([
15
            'bin/usage-finder',
16
            'find',
17
            'tests/example',
18
            'Doctrine\Common\Collections\Collection::slice',
19
        ], __DIR__ . '/..');
20
21
        $process->mustRun();
22
23
        $output = $process->getOutput();
24
25
        self::assertStringContainsString(
0 ignored issues
show
Bug introduced by
The method assertStringContainsString() does not exist on UsageFinder\Tests\ConsoleTest. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

25
        self::/** @scrutinizer ignore-call */ 
26
              assertStringContainsString(

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
26
            'Searching for Doctrine\Common\Collections\Collection::slice in tests/example.',
27
            $output
28
        );
29
30
        self::assertStringContainsString(
31
            'Found usage in src/AppCode.php on line 14.',
32
            $output
33
        );
34
35
        self::assertStringContainsString(
36
            '->slice(0, 1);',
37
            $output
38
        );
39
40
        self::assertStringContainsString(
41
            'Found usage in src/AppCode.php on line 17.',
42
            $output
43
        );
44
45
        self::assertStringContainsString(
46
            '->slice(0, 2);',
47
            $output
48
        );
49
50
        self::assertStringContainsString(
51
            'Found usage in src/AppCode.php on line 20.',
52
            $output
53
        );
54
55
        self::assertStringContainsString(
56
            '->slice(0, 3);',
57
            $output
58
        );
59
60
        self::assertRegExp('/Finished in (.*)ms/', $output);
0 ignored issues
show
Bug introduced by
The method assertRegExp() does not exist on UsageFinder\Tests\ConsoleTest. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

60
        self::/** @scrutinizer ignore-call */ 
61
              assertRegExp('/Finished in (.*)ms/', $output);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
61
    }
62
}
63