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

GuessCodePathTest::testInvokeThrowsRuntimeException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace UsageFinder\Tests;
6
7
use PHPUnit\Framework\TestCase;
8
use UsageFinder\GuessCodePath;
9
use function sys_get_temp_dir;
10
11
final class GuessCodePathTest extends TestCase
12
{
13
    public function testInvoke() : void
14
    {
15
        self::assertSame('src', (new GuessCodePath())->__invoke(__DIR__ . '/example'));
0 ignored issues
show
Bug introduced by
'src' 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

15
        self::assertSame(/** @scrutinizer ignore-type */ 'src', (new GuessCodePath())->__invoke(__DIR__ . '/example'));
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

15
        self::/** @scrutinizer ignore-call */ 
16
              assertSame('src', (new GuessCodePath())->__invoke(__DIR__ . '/example'));
Loading history...
16
    }
17
18
    public function testInvokeReturnsNull() : void
19
    {
20
        $path = sys_get_temp_dir() . '/usage-finder-does-not-exist';
21
22
        self::assertNull((new GuessCodePath())->__invoke($path));
23
    }
24
}
25