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
|
|||||||
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
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
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. ![]() |
|||||||
60 | } |
||||||
61 | } |
||||||
62 |
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.