Skip to content
Snippets Groups Projects
Commit bc46e4fa authored by Ivan Gavryshko's avatar Ivan Gavryshko
Browse files

MAGETWO-36070: Move dev/tools/performance-toolkit/generate.php

- added command test
parent f85ca9d4
Branches
No related merge requests found
......@@ -23,7 +23,7 @@ class GenerateFixturesCommand extends Command
const PROFILE_ARGUMENT = 'profile';
/**
* @var Application
* @var FixtureModel
*/
private $application;
......
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Setup\Test\Unit\Console\Command;
use Magento\Setup\Fixtures\FixtureModel;
use Magento\Setup\Console\Command\GenerateFixturesCommand;
use Symfony\Component\Console\Tester\CommandTester;
class GenerateFixturesCommandTest extends \PHPUnit_Framework_TestCase
{
/**
* @var FixtureModel|\PHPUnit_Framework_MockObject_MockObject
*/
private $fixtureModel;
public function setUp()
{
$this->fixtureModel = $this->getMock('Magento\Setup\Fixtures\FixtureModel', [], [], '', false);
$this->command = new GenerateFixturesCommand($this->fixtureModel);
}
public function testExecute()
{
$this->fixtureModel->expects($this->once())->method('loadConfig')->with('path_to_profile.xml');
$this->fixtureModel->expects($this->once())->method('initObjectManager');
$this->fixtureModel->expects($this->once())->method('loadFixtures');
$commandTester = new CommandTester($this->command);
$commandTester->execute(['profile' => 'path_to_profile.xml']);
}
/**
* @expectedException \RuntimeException
* @expectedExceptionMessage Not enough arguments.
*/
public function testExecuteInvalidLanguageArgument()
{
$commandTester = new CommandTester($this->command);
$commandTester->execute([]);
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment