Completed
Push — master ( 96d434...f2324b )
by Daniel
04:52 queued 55s
created

doctrine-orm/tests/Functional/OrmTestCase.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Psi\Bridge\ContentType\Doctrine\Orm\Tests\Functional;
4
5
use Doctrine\ORM\EntityManagerInterface;
6
use Doctrine\ORM\Tools\SchemaTool;
7
use Psi\Component\ContentType\Tests\Functional\Example\Model\Image;
8
9
class OrmTestCase extends \PHPUnit_Framework_TestCase
10
{
11
    protected function getContainer(array $config = [])
12
    {
13
        return new Container($config);
14
    }
15
16
    protected function initOrm(EntityManagerInterface $entityManager)
17
    {
18
        $schemaTool = new SchemaTool($entityManager);
19
        $metadatas = $entityManager->getMetadataFactory()->getAllMetadata();
20
        $schemaTool->dropSchema($metadatas);
21
        $schemaTool->createSchema($metadatas);
22
    }
23
24 View Code Duplication
    protected function createImage($path, $width, $height, $mimeType)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
    {
26
        $image = new Image();
27
        $image->path = $path;
28
        $image->width = $width;
29
        $image->height = $height;
30
        $image->mimetype = $mimeType;
31
32
        return $image;
33
    }
34
}
35