Issues (35)

tests/ClassMethodUsageTest.php (6 issues)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace UsageFinder\Tests;
6
7
use UsageFinder\ClassMethodUsage;
8
9
final class ClassMethodUsageTest extends TestCase
10
{
11
    public function testGetFile() : void
12
    {
13
        self::assertSame('src/Test.php', (new ClassMethodUsage('src/Test.php', 1, '', ''))->getFile());
0 ignored issues
show
'src/Test.php' of type string is incompatible with the type PHPUnit\Framework\T expected by parameter $expected of PHPUnit\Framework\Assert::assertSame(). ( Ignorable by Annotation )

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

13
        self::assertSame(/** @scrutinizer ignore-type */ 'src/Test.php', (new ClassMethodUsage('src/Test.php', 1, '', ''))->getFile());
Loading history...
Bug Best Practice introduced by
The method PHPUnit\Framework\Assert::assertSame() is not static, but was called statically. ( Ignorable by Annotation )

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

13
        self::/** @scrutinizer ignore-call */ 
14
              assertSame('src/Test.php', (new ClassMethodUsage('src/Test.php', 1, '', ''))->getFile());
Loading history...
14
    }
15
16
    public function testGetLine() : void
17
    {
18
        self::assertSame(1, (new ClassMethodUsage('src/Test.php', 1, '', ''))->getLine());
0 ignored issues
show
1 of type integer is incompatible with the type PHPUnit\Framework\T expected by parameter $expected of PHPUnit\Framework\Assert::assertSame(). ( Ignorable by Annotation )

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

18
        self::assertSame(/** @scrutinizer ignore-type */ 1, (new ClassMethodUsage('src/Test.php', 1, '', ''))->getLine());
Loading history...
Bug Best Practice introduced by
The method PHPUnit\Framework\Assert::assertSame() is not static, but was called statically. ( Ignorable by Annotation )

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

18
        self::/** @scrutinizer ignore-call */ 
19
              assertSame(1, (new ClassMethodUsage('src/Test.php', 1, '', ''))->getLine());
Loading history...
19
    }
20
21
    public function testGetConsoleSnippet() : void
22
    {
23
        self::assertSame(
0 ignored issues
show
Bug Best Practice introduced by
The method PHPUnit\Framework\Assert::assertSame() is not static, but was called statically. ( Ignorable by Annotation )

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

23
        self::/** @scrutinizer ignore-call */ 
24
              assertSame(
Loading history...
24
            '$variable-><info>method</info>();',
0 ignored issues
show
'$variable-><info>method</info>();' of type string is incompatible with the type PHPUnit\Framework\T expected by parameter $expected of PHPUnit\Framework\Assert::assertSame(). ( Ignorable by Annotation )

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

24
            /** @scrutinizer ignore-type */ '$variable-><info>method</info>();',
Loading history...
25
            (new ClassMethodUsage('src/Test.php', 1, '$variable->method();', 'method'))->getConsoleSnippet()
26
        );
27
    }
28
}
29