-
-
Notifications
You must be signed in to change notification settings - Fork 213
/
DoctrineCommandTest.php
34 lines (28 loc) · 1.23 KB
/
DoctrineCommandTest.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
<?php
namespace Doctrine\Bundle\MigrationsBundle\Tests\DependencyInjection;
use Doctrine\Bundle\MigrationsBundle\Command\DoctrineCommand;
use Doctrine\DBAL\Migrations\Configuration\Configuration;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
class DoctrineCommandTest extends \PHPUnit\Framework\TestCase
{
public function testConfigureMigrations()
{
$configurationMock = $this->getMockBuilder('Doctrine\DBAL\Migrations\Configuration\Configuration')
->disableOriginalConstructor()
->getMock();
$configurationMock->method('getMigrations')
->willReturn(array());
DoctrineCommand::configureMigrations($this->getContainer(), $configurationMock);
}
private function getContainer()
{
return new ContainerBuilder(new ParameterBag(array(
'doctrine_migrations.dir_name' => __DIR__.'/../../',
'doctrine_migrations.namespace' => 'test',
'doctrine_migrations.name' => 'test',
'doctrine_migrations.table_name' => 'test',
'doctrine_migrations.organize_migrations' => Configuration::VERSIONS_ORGANIZATION_BY_YEAR,
)));
}
}