Passed
Push — master ( c160bf...1e629a )
by Wilmer
02:40
created

IndexControllerTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Tests\Functional;
6
7
use PHPUnit\Framework\TestCase;
8
use Yiisoft\Yii\Testing\FunctionalTester;
9
10
final class IndexControllerTest extends TestCase
11
{
12
    private ?FunctionalTester $tester;
13
14
    protected function setUp(): void
15
    {
16
        $this->tester = new FunctionalTester();
17
    }
18
19
    public function testGetIndex()
20
    {
21
        $method = 'GET';
22
        $url = '/';
23
24
        $this->tester->bootstrapApplication('web', dirname(__DIR__, 2));
0 ignored issues
show
Bug introduced by
The method bootstrapApplication() does not exist on null. ( Ignorable by Annotation )

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

24
        $this->tester->/** @scrutinizer ignore-call */ 
25
                       bootstrapApplication('web', dirname(__DIR__, 2));

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
        $response = $this->tester->doRequest($method, $url);
26
27
        $this->assertStringContainsString('Hello, everyone', $response->getContent());
28
    }
29
}
30