Skip to content
Snippets Groups Projects
Commit aace47d9 authored by Eddie Lau's avatar Eddie Lau
Browse files

MAGETWO-36071: Move dev/tools/Magento/Tools/Dependency/generate/*.dependencies.php tools

- changed according to CR feedback
parent 29f380c5
No related merge requests found
Showing
with 26 additions and 20 deletions
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Copyright © 2015 Magento. All rights reserved. * Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details. * See COPYING.txt for license details.
*/ */
namespace Magento\Test\Tool\Console\Command; namespace Magento\Test\Tools\Console\Command;
use Magento\Tools\Console\Command\DependenciesShowFrameworkCommand; use Magento\Tools\Console\Command\DependenciesShowFrameworkCommand;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
...@@ -38,7 +38,7 @@ class DependenciesShowFrameworkCommandTest extends \PHPUnit_Framework_TestCase ...@@ -38,7 +38,7 @@ class DependenciesShowFrameworkCommandTest extends \PHPUnit_Framework_TestCase
$this->commandTester->execute( $this->commandTester->execute(
['--directory' => __DIR__ . '/_files/root', '--output' => __DIR__ . '/_files/output/framework.csv'] ['--directory' => __DIR__ . '/_files/root', '--output' => __DIR__ . '/_files/output/framework.csv']
); );
$this->assertEquals('Report successfully processed.' . PHP_EOL , $this->commandTester->getDisplay()); $this->assertEquals('Report successfully processed.' . PHP_EOL, $this->commandTester->getDisplay());
$this->assertFileEquals( $this->assertFileEquals(
__DIR__ . '/_files/expected/framework.csv', __DIR__ . '/_files/expected/framework.csv',
__DIR__ . '/_files/output/framework.csv' __DIR__ . '/_files/output/framework.csv'
...@@ -49,7 +49,7 @@ class DependenciesShowFrameworkCommandTest extends \PHPUnit_Framework_TestCase ...@@ -49,7 +49,7 @@ class DependenciesShowFrameworkCommandTest extends \PHPUnit_Framework_TestCase
{ {
$this->commandTester->execute(['--directory' => '/invalid/path']); $this->commandTester->execute(['--directory' => '/invalid/path']);
$this->assertContains( $this->assertContains(
'Please, check passed path. Dependencies report generator failed:', 'Please check the path you provided. Dependencies report generator failed with error:',
$this->commandTester->getDisplay() $this->commandTester->getDisplay()
); );
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Copyright © 2015 Magento. All rights reserved. * Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details. * See COPYING.txt for license details.
*/ */
namespace Magento\Test\Tool\Console\Command; namespace Magento\Test\Tools\Console\Command;
use Magento\Tools\Console\Command\DependenciesShowModulesCircularCommand; use Magento\Tools\Console\Command\DependenciesShowModulesCircularCommand;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
...@@ -38,7 +38,7 @@ class DependenciesShowModulesCircularCommandTest extends \PHPUnit_Framework_Test ...@@ -38,7 +38,7 @@ class DependenciesShowModulesCircularCommandTest extends \PHPUnit_Framework_Test
$this->commandTester->execute( $this->commandTester->execute(
['--directory' => __DIR__ . '/_files/root', '--output' => __DIR__ . '/_files/output/circular.csv'] ['--directory' => __DIR__ . '/_files/root', '--output' => __DIR__ . '/_files/output/circular.csv']
); );
$this->assertEquals('Report successfully processed.' . PHP_EOL , $this->commandTester->getDisplay()); $this->assertEquals('Report successfully processed.' . PHP_EOL, $this->commandTester->getDisplay());
$this->assertFileEquals( $this->assertFileEquals(
__DIR__ . '/_files/expected/circular.csv', __DIR__ . '/_files/expected/circular.csv',
__DIR__ . '/_files/output/circular.csv' __DIR__ . '/_files/output/circular.csv'
...@@ -49,7 +49,7 @@ class DependenciesShowModulesCircularCommandTest extends \PHPUnit_Framework_Test ...@@ -49,7 +49,7 @@ class DependenciesShowModulesCircularCommandTest extends \PHPUnit_Framework_Test
{ {
$this->commandTester->execute(['--directory' => '/invalid/path']); $this->commandTester->execute(['--directory' => '/invalid/path']);
$this->assertContains( $this->assertContains(
'Please, check passed path. Dependencies report generator failed:', 'Please check the path you provided. Dependencies report generator failed with error:',
$this->commandTester->getDisplay() $this->commandTester->getDisplay()
); );
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Copyright © 2015 Magento. All rights reserved. * Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details. * See COPYING.txt for license details.
*/ */
namespace Magento\Test\Tool\Console\Command; namespace Magento\Test\Tools\Console\Command;
use Magento\Tools\Console\Command\DependenciesShowModulesCommand; use Magento\Tools\Console\Command\DependenciesShowModulesCommand;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
...@@ -38,7 +38,7 @@ class DependenciesShowModulesCommandTest extends \PHPUnit_Framework_TestCase ...@@ -38,7 +38,7 @@ class DependenciesShowModulesCommandTest extends \PHPUnit_Framework_TestCase
$this->commandTester->execute( $this->commandTester->execute(
['--directory' => __DIR__ . '/_files/root', '--output' => __DIR__ . '/_files/output/modules.csv'] ['--directory' => __DIR__ . '/_files/root', '--output' => __DIR__ . '/_files/output/modules.csv']
); );
$this->assertEquals('Report successfully processed.' . PHP_EOL , $this->commandTester->getDisplay()); $this->assertEquals('Report successfully processed.' . PHP_EOL, $this->commandTester->getDisplay());
$this->assertFileEquals( $this->assertFileEquals(
__DIR__ . '/_files/expected/modules.csv', __DIR__ . '/_files/expected/modules.csv',
__DIR__ . '/_files/output/modules.csv' __DIR__ . '/_files/output/modules.csv'
...@@ -49,7 +49,7 @@ class DependenciesShowModulesCommandTest extends \PHPUnit_Framework_TestCase ...@@ -49,7 +49,7 @@ class DependenciesShowModulesCommandTest extends \PHPUnit_Framework_TestCase
{ {
$this->commandTester->execute(['--directory' => '/invalid/path']); $this->commandTester->execute(['--directory' => '/invalid/path']);
$this->assertContains( $this->assertContains(
'Please, check passed path. Dependencies report generator failed:', 'Please check the path you provided. Dependencies report generator failed with error:',
$this->commandTester->getDisplay() $this->commandTester->getDisplay()
); );
} }
......
...@@ -7,6 +7,9 @@ namespace Magento\A\Model; ...@@ -7,6 +7,9 @@ namespace Magento\A\Model;
class Foo class Foo
{ {
/**
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
*/
public function foo() public function foo()
{ {
$frameworkDependencies = new \Magento\Framework\A(); $frameworkDependencies = new \Magento\Framework\A();
......
...@@ -7,6 +7,9 @@ namespace Magento\B\Model; ...@@ -7,6 +7,9 @@ namespace Magento\B\Model;
class Foo class Foo
{ {
/**
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
*/
public function foo() public function foo()
{ {
$frameworkDependencies = new \Magento\Framework\B(); $frameworkDependencies = new \Magento\Framework\B();
......
...@@ -40,8 +40,8 @@ abstract class AbstractDependenciesCommand extends Command ...@@ -40,8 +40,8 @@ abstract class AbstractDependenciesCommand extends Command
self::INPUT_KEY_OUTPUT, self::INPUT_KEY_OUTPUT,
'o', 'o',
InputOption::VALUE_REQUIRED, InputOption::VALUE_REQUIRED,
'Path to report file', 'Report filename',
$this->getDefaultOutputPath() $this->getDefaultOutputFilename()
) )
] ]
); );
...@@ -57,11 +57,11 @@ abstract class AbstractDependenciesCommand extends Command ...@@ -57,11 +57,11 @@ abstract class AbstractDependenciesCommand extends Command
abstract protected function buildReport($outputPath); abstract protected function buildReport($outputPath);
/** /**
* Get path to the default output report file * Get the default output report filename
* *
* @return string * @return string
*/ */
abstract protected function getDefaultOutputPath(); abstract protected function getDefaultOutputFilename();
/** /**
* {@inheritdoc} * {@inheritdoc}
...@@ -74,7 +74,7 @@ abstract class AbstractDependenciesCommand extends Command ...@@ -74,7 +74,7 @@ abstract class AbstractDependenciesCommand extends Command
$output->writeln('<info>Report successfully processed.</info>'); $output->writeln('<info>Report successfully processed.</info>');
} catch (\Exception $e) { } catch (\Exception $e) {
$output->writeln( $output->writeln(
'<error>Please, check passed path. Dependencies report generator failed: ' . '<error>Please check the path you provided. Dependencies report generator failed with error: ' .
$e->getMessage() . '</error>' $e->getMessage() . '</error>'
); );
} }
......
...@@ -24,11 +24,11 @@ class DependenciesShowFrameworkCommand extends AbstractDependenciesCommand ...@@ -24,11 +24,11 @@ class DependenciesShowFrameworkCommand extends AbstractDependenciesCommand
} }
/** /**
* Return default output file for framework dependencies report * Return default output filename for framework dependencies report
* *
* @return string * @return string
*/ */
protected function getDefaultOutputPath() protected function getDefaultOutputFilename()
{ {
return 'framework-dependencies.csv'; return 'framework-dependencies.csv';
} }
......
...@@ -24,11 +24,11 @@ class DependenciesShowModulesCircularCommand extends AbstractDependenciesCommand ...@@ -24,11 +24,11 @@ class DependenciesShowModulesCircularCommand extends AbstractDependenciesCommand
} }
/** /**
* Return default output file for modules circular dependencies report * Return default output filename for modules circular dependencies report
* *
* @return string * @return string
*/ */
protected function getDefaultOutputPath() protected function getDefaultOutputFilename()
{ {
return 'modules-circular-dependencies.csv'; return 'modules-circular-dependencies.csv';
} }
......
...@@ -24,11 +24,11 @@ class DependenciesShowModulesCommand extends AbstractDependenciesCommand ...@@ -24,11 +24,11 @@ class DependenciesShowModulesCommand extends AbstractDependenciesCommand
} }
/** /**
* Return default output file for modules dependencies report * Return default output filename for modules dependencies report
* *
* @return string * @return string
*/ */
protected function getDefaultOutputPath() protected function getDefaultOutputFilename()
{ {
return 'modules-dependencies.csv'; return 'modules-dependencies.csv';
} }
......
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