Skip to content

Commit

Permalink
Change DoctrineOrmLoadDataFixturesCommand to DoctrineOdmLoadDataFixtu…
Browse files Browse the repository at this point in the history
…resCommand
  • Loading branch information
Hendrik Knigge committed Sep 30, 2019
1 parent a480155 commit 0cb6e89
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion resources/config/command.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<services>
<service id="hautelook_alice.console.command.doctrine.doctrine_orm_load_data_fixtures_command"
class="Hautelook\AliceBundle\Console\Command\Doctrine\DoctrineOrmLoadDataFixturesCommand"
class="Hautelook\AliceBundle\Console\Command\Doctrine\DoctrineOdmLoadDataFixturesCommand"
public="true">
<argument type="string">hautelook:fixtures:load</argument>
<argument type="service" id="doctrine" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Hautelook\AliceBundle\Console\Command\Doctrine;

use Doctrine\Common\Persistence\ManagerRegistry;
use Hautelook\AliceBundle\LoaderInterface as AliceBundleLoaderInterface;
use Hautelook\AliceBundle\Loader\DoctrineOdmLoader as AliceBundleLoaderInterface;
use RuntimeException;
use Symfony\Bundle\FrameworkBundle\Console\Application as FrameworkBundleConsoleApplication;
use Symfony\Component\Console\Application as ConsoleApplication;
Expand All @@ -26,7 +26,7 @@
/**
* Command used to load the fixtures.
*/
class DoctrineOrmLoadDataFixturesCommand extends Command
class DoctrineOdmLoadDataFixturesCommand extends Command
{
/**
* @var ManagerRegistry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class LoadDataFixturesCommandIntegrationTest extends TestCase
private $kernel;

/**
* @var DoctrineOrmLoadDataFixturesCommand
* @var DoctrineOdmLoadDataFixturesCommand
*/
private $command;

Expand Down
14 changes: 7 additions & 7 deletions tests/Console/Command/Doctrine/LoadDataFixturesCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,28 @@
use Symfony\Component\Console\Output\NullOutput;

/**
* @covers \Hautelook\AliceBundle\Console\Command\Doctrine\DoctrineOrmLoadDataFixturesCommand
* @covers \Hautelook\AliceBundle\Console\Command\Doctrine\DoctrineOdmLoadDataFixturesCommand
*/
class LoadDataFixturesCommandTest extends TestCase
{
public function testIsACommand()
{
$this->assertTrue(is_a(DoctrineOrmLoadDataFixturesCommand::class, Command::class, true));
$this->assertTrue(is_a(DoctrineOdmLoadDataFixturesCommand::class, Command::class, true));
}

public function testCanSetTheCommandApplication()
{
$application = new FrameworkBundleConsoleApplication(new DummyKernel());

$command = new DoctrineOrmLoadDataFixturesCommand('dummy', new FakeDoctrineManagerRegistry(), new FakeLoader());
$command = new DoctrineOdmLoadDataFixturesCommand('dummy', new FakeDoctrineManagerRegistry(), new FakeLoader());
$command->setApplication($application);

$this->assertSame($application, $command->getApplication());
}

public function testCanResetTheCommandApplication()
{
$command = new DoctrineOrmLoadDataFixturesCommand('dummy', new FakeDoctrineManagerRegistry(), new FakeLoader());
$command = new DoctrineOdmLoadDataFixturesCommand('dummy', new FakeDoctrineManagerRegistry(), new FakeLoader());
$command->setApplication(null);

$this->assertTrue(true);
Expand All @@ -60,7 +60,7 @@ public function testCanResetTheCommandApplication()
*/
public function testThrowsAnExceptionIfInvalidApplicationIsGiven()
{
$command = new DoctrineOrmLoadDataFixturesCommand('dummy', new FakeDoctrineManagerRegistry(), new FakeLoader());
$command = new DoctrineOdmLoadDataFixturesCommand('dummy', new FakeDoctrineManagerRegistry(), new FakeLoader());
$command->setApplication(new ConsoleApplication());
}

Expand Down Expand Up @@ -89,7 +89,7 @@ public function testCallCommandWithoutArguments()
/** @var LoaderInterface $loader */
$loader = $loaderProphecy->reveal();

$command = new DoctrineOrmLoadDataFixturesCommand('dummy', $managerRegistry, $loader);
$command = new DoctrineOdmLoadDataFixturesCommand('dummy', $managerRegistry, $loader);
$command->setApplication($application);
$exit = $command->run($input, new NullOutput());

Expand Down Expand Up @@ -132,7 +132,7 @@ public function testCallCommandWithArguments()
/** @var LoaderInterface $loader */
$loader = $loaderProphecy->reveal();

$command = new DoctrineOrmLoadDataFixturesCommand('dummy', $managerRegistry, $loader);
$command = new DoctrineOdmLoadDataFixturesCommand('dummy', $managerRegistry, $loader);
$command->setApplication($application);
$exit = $command->run($input, new NullOutput());

Expand Down
2 changes: 1 addition & 1 deletion tests/DependencyInjection/HautelookAliceBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function testServiceRegistration()

// Commands
$this->assertInstanceOf(
\Hautelook\AliceBundle\Console\Command\Doctrine\DoctrineOrmLoadDataFixturesCommand::class,
\Hautelook\AliceBundle\Console\Command\Doctrine\DoctrineOdmLoadDataFixturesCommand::class,
$this->kernel->getContainer()->get('hautelook_alice.console.command.doctrine.doctrine_orm_load_data_fixtures_command')
);
}
Expand Down

0 comments on commit 0cb6e89

Please sign in to comment.