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

api-platform / core / 8361372447

20 Mar 2024 03:15PM UTC coverage: 66.752% (-5.7%) from 72.431%
8361372447

push

github

web-flow
chore: doctrine deprecations (#6237)

0 of 1 new or added line in 1 file covered. (0.0%)

16369 of 24522 relevant lines covered (66.75%)

38.28 hits per line

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

0.0
/src/Test/DoctrineMongoDbOdmTestCase.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\Test;
15

16
use Doctrine\ODM\MongoDB\Configuration;
17
use Doctrine\ODM\MongoDB\DocumentManager;
18
use Doctrine\ODM\MongoDB\Mapping\Driver\AttributeDriver;
19
use Doctrine\ODM\MongoDB\Mapping\Driver\AttributeReader;
20
use PHPUnit\Framework\TestCase;
21
use Symfony\Component\Cache\Adapter\ArrayAdapter;
22

23
/**
24
 * Source: https://github.com/doctrine/DoctrineMongoDBBundle/blob/0174003844bc566bb4cb3b7d10c5528d1924d719/Tests/TestCase.php
25
 * Test got excluded from vendor in 4.x.
26
 */
27
class DoctrineMongoDbOdmTestCase extends TestCase
28
{
29
    public static function createTestDocumentManager($paths = []): DocumentManager
30
    {
31
        $config = new Configuration();
×
32
        $config->setAutoGenerateProxyClasses(Configuration::AUTOGENERATE_FILE_NOT_EXISTS);
×
33
        $config->setProxyDir(sys_get_temp_dir());
×
34
        $config->setHydratorDir(sys_get_temp_dir());
×
35
        $config->setProxyNamespace('SymfonyTests\Doctrine');
×
36
        $config->setHydratorNamespace('SymfonyTests\Doctrine');
×
NEW
37
        $config->setMetadataDriverImpl(new AttributeDriver($paths, class_exists(\Doctrine\Common\Annotations\Reader::class) ? new AttributeReader() : null)); // @phpstan-ignore-line type is only documented as phpdoc
×
38
        $config->setMetadataCache(new ArrayAdapter());
×
39

40
        return DocumentManager::create(null, $config);
×
41
    }
42
}
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