We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
1 | <?php |
||
22 | abstract class TestCase extends WebTestCase |
||
23 | { |
||
24 | /** |
||
25 | * @var AppKernel[] |
||
26 | */ |
||
27 | private static $kernels = []; |
||
28 | |||
29 | protected static function getKernelClass() |
||
30 | { |
||
31 | require_once __DIR__.'/app/AppKernel.php'; |
||
32 | |||
33 | return 'Overblog\GraphQLBundle\Tests\Functional\app\AppKernel'; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | protected static function createKernel(array $options = []) |
||
40 | { |
||
41 | if (null === static::$class) { |
||
42 | static::$class = static::getKernelClass(); |
||
43 | } |
||
44 | |||
45 | $options['test_case'] = isset($options['test_case']) ? $options['test_case'] : null; |
||
46 | |||
47 | $env = isset($options['environment']) ? $options['environment'] : 'overbloggraphbundletest'.strtolower($options['test_case']); |
||
48 | $debug = isset($options['debug']) ? $options['debug'] : true; |
||
49 | |||
50 | $kernelKey = $options['test_case'] ?: '__default__'; |
||
51 | $kernelKey .= '//'.$env.'//'.var_export($debug, true); |
||
52 | |||
53 | if (!isset(self::$kernels[$kernelKey])) { |
||
54 | self::$kernels[$kernelKey] = new static::$class($env, $debug, $options['test_case']); |
||
55 | } |
||
56 | |||
57 | return self::$kernels[$kernelKey]; |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | public static function setUpBeforeClass() |
||
64 | { |
||
65 | $fs = new Filesystem(); |
||
66 | $fs->remove(sys_get_temp_dir().'/OverblogGraphQLBundle/'); |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | protected function tearDown() |
||
76 | |||
77 | protected static function createAndBootKernel(array $options = []) |
||
78 | { |
||
79 | static::bootKernel($options); |
||
83 | |||
84 | protected static function executeGraphQLRequest($query, $rootValue = [], $throwException = false) |
||
96 | |||
97 | protected static function assertGraphQL($query, array $expectedData = null, array $expectedErrors = null, $rootValue = []) |
||
113 | |||
114 | protected static function getContainer() |
||
118 | } |
||
119 |