Passed
Pull Request — master (#52)
by Matthieu
04:27
created

AbstractWebTestCase   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 32
rs 10
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 7 2
A getParentContainer() 0 7 2
A getKernelClass() 0 3 1
1
<?php declare(strict_types = 1);
2
3
namespace AtlassianConnectBundle\Tests\Functional;
4
5
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
6
use Symfony\Component\DependencyInjection\ContainerInterface;
7
use Symfony\Component\HttpKernel\Kernel;
8
9
/**
10
 * abstract class AbstractWebTestCase
11
 */
12
abstract class AbstractWebTestCase extends WebTestCase
13
{
14
    /**
15
     * setup method
16
     */
17
    protected function setUp(): void
18
    {
19
        if (Kernel::VERSION_ID >= 50100) {
20
            return;
21
        }
22
23
        $this->markTestSkipped('These tests only run on Symfony 5.2 or higher');
24
    }
25
26
    /**
27
     * @return ContainerInterface
28
     */
29
    public static function getParentContainer(): ContainerInterface
30
    {
31
        if (\method_exists(self::class, 'getContainer')) {
32
            return self::getContainer();
33
        }
34
35
        return self::$container;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    protected static function getKernelClass()
42
    {
43
        return 'AtlassianConnectBundle\Tests\Functional\App\Kernel';
44
    }
45
}
46