• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

api-platform / core / 10014117656

19 Jul 2024 08:44PM UTC coverage: 7.856% (-56.3%) from 64.185%
10014117656

push

github

soyuka
Merge branch 'sf/remove-flag'

0 of 527 new or added lines in 83 files covered. (0.0%)

10505 existing lines in 362 files now uncovered.

12705 of 161727 relevant lines covered (7.86%)

26.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Doctrine/Odm/Tests/AppKernel.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\Doctrine\Odm\Tests;
15

16
use Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle;
17
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
18
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
19
use Symfony\Component\Config\Loader\LoaderInterface;
20
use Symfony\Component\DependencyInjection\ContainerBuilder;
21
use Symfony\Component\HttpKernel\Bundle\Bundle;
22
use Symfony\Component\HttpKernel\Kernel;
23

24
/**
25
 * AppKernel for tests.
26
 *
27
 * @author Kévin Dunglas <dunglas@gmail.com>
28
 */
29
class AppKernel extends Kernel
30
{
31
    use MicroKernelTrait;
32

33
    public function __construct(string $environment, bool $debug)
34
    {
35
        parent::__construct($environment, $debug);
×
36

37
        // patch for behat/symfony2-extension not supporting %env(APP_ENV)%
38
        $this->environment = $_SERVER['APP_ENV'] ?? $environment;
×
39
    }
40

41
    public function registerBundles(): array
42
    {
43
        return [
×
44
            new FrameworkBundle(),
×
45
            new DoctrineMongoDBBundle(),
×
NEW
46
            new class() extends Bundle {
×
47
                public function shutdown(): void
48
                {
NEW
49
                    restore_exception_handler();
×
50
                }
NEW
51
            },
×
52
        ];
×
53
    }
54

55
    public function getProjectDir(): string
56
    {
57
        return __DIR__;
×
58
    }
59

60
    protected function configureRoutes($routes): void
61
    {
62
    }
×
63

64
    protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader): void
65
    {
66
        $c->setParameter('kernel.project_dir', __DIR__);
×
67

68
        $cookie = ['cookie_secure' => true, 'cookie_samesite' => 'lax', 'handler_id' => 'session.handler.native_file'];
×
69
        $config = [
×
70
            'secret' => 'dunglas.fr',
×
71
            'validation' => ['enable_attributes' => true, 'email_validation_mode' => 'html5'],
×
72
            'serializer' => ['enable_attributes' => true],
×
73
            'test' => null,
×
74
            'session' => ['storage_factory_id' => 'session.storage.factory.mock_file'] + $cookie,
×
75
            'profiler' => ['enabled' => false],
×
76
            'property_access' => ['enabled' => true],
×
77
            'php_errors' => ['log' => true],
×
78
            'router' => ['utf8' => true],
×
79
            'http_method_override' => false,
×
80
            'annotations' => false,
×
81
            'handle_all_throwables' => true,
×
82
            'uid' => ['default_uuid_version' => 7, 'time_based_uuid_version' => 7],
×
83
        ];
×
84

85
        $c->prependExtensionConfig('framework', $config);
×
86

87
        $loader->load(__DIR__.'/config.yml');
×
88
    }
89

90
    protected function build(ContainerBuilder $container): void
91
    {
92
    }
×
93
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc