Failed Conditions
Pull Request — master (#3)
by Jonathan
02:15
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 Symfony\Component\Process\Process;
8
9
final class ConsoleTest extends TestCase
10
{
11
    public function testExecute() : void
12
    {
13
        $process = new Process([
14
            'bin/usage-finder',
15
            'find',
16
            'tests/example',
17
            'Doctrine\Common\Collections\Collection::slice',
18
        ], __DIR__ . '/..');
19
20
        $process->mustRun();
21
22
        $output = $process->getOutput();
23
24
        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

24
        self::/** @scrutinizer ignore-call */ 
25
              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...
25
            'Searching for Doctrine\Common\Collections\Collection::slice in tests/example.',
26
            $output
27
        );
28
29
        self::assertStringContainsString(
30
            'Found usage in src/AppCode.php on line 14.',
31
            $output
32
        );
33
34
        self::assertStringContainsString(
35
            '->slice(0, 1);',
36
            $output
37
        );
38
39
        self::assertStringContainsString(
40
            'Found usage in src/AppCode.php on line 17.',
41
            $output
42
        );
43
44
        self::assertStringContainsString(
45
            '->slice(0, 2);',
46
            $output
47
        );
48
49
        self::assertStringContainsString(
50
            'Found usage in src/AppCode.php on line 20.',
51
            $output
52
        );
53
54
        self::assertStringContainsString(
55
            '->slice(0, 3);',
56
            $output
57
        );
58
59
        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

59
        self::/** @scrutinizer ignore-call */ 
60
              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...
60
    }
61
}
62