/
LoadDataFixturesDoctrineCommandTest.php
36 lines (29 loc) · 1.23 KB
/
LoadDataFixturesDoctrineCommandTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types=1);
namespace Doctrine\Bundle\FixturesBundle\Tests\Command;
use Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand;
use Doctrine\Bundle\FixturesBundle\Loader\SymfonyFixturesLoader;
use Doctrine\Common\Persistence\ManagerRegistry;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Container;
class LoadDataFixturesDoctrineCommandTest extends TestCase
{
/**
* @group legacy
* @expectedDeprecation The "Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand" constructor expects a "Doctrine\Common\Persistence\ManagerRegistry" instance as second argument, not passing it will throw a \TypeError in DoctrineFixturesBundle 4.0.
*/
public function testInstantiatingWithoutManagerRegistry() : void
{
$loader = new SymfonyFixturesLoader(new Container());
new LoadDataFixturesDoctrineCommand($loader);
}
/**
* @doesNotPerformAssertions
*/
public function testInstantiatingWithManagerRegistry() : void
{
$registry = $this->createMock(ManagerRegistry::class);
$loader = new SymfonyFixturesLoader(new Container());
new LoadDataFixturesDoctrineCommand($loader, $registry);
}
}