Skip to content

Commit bfcc3d3

Browse files
author
Eugene Tulika
committed
MAGETWO-44440: Register URN resolver to resolve internal dependencies
- Fixed static tests
1 parent 276bed4 commit bfcc3d3

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

app/code/Magento/Developer/Console/Command/XmlCatalogGenerateCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ protected function configure()
9292
new InputOption(
9393
self::IDE_OPTION,
9494
null,
95-
InputOption::VALUE_OPTIONAL,
95+
InputOption::VALUE_REQUIRED,
9696
'Format in which catalog will be generated. Supported: ['.
97-
implode(', ', $this->getSupportedFormats()) . ']',
97+
implode(', ', $this->getSupportedFormats()) . ']',
9898
'phpstorm'
9999
),
100100
new InputArgument(
@@ -154,7 +154,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
154154
if ($formatter = $this->getFormatters($ideName)) {
155155
$formatter->generateCatalog($urnDictionary, $absolutePath);
156156
} else {
157-
throw new InputException(__("Format for IDE '%ide' is not supported", ['ide' => $ideName]));
157+
throw new InputException(__("Format for IDE '%1' is not supported", $ideName));
158158
}
159159
}
160160

app/code/Magento/Developer/Model/XmlCatalog/Format/FormatInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ interface FormatInterface
1919
* @return void
2020
*/
2121
public function generateCatalog(array $dictionary, $path);
22-
}
22+
}

app/code/Magento/Developer/Model/XmlCatalog/Format/PhpStorm.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Framework\Filesystem\Directory\ReadFactory;
1010
use Magento\Framework\Filesystem\Directory\ReadInterface;
1111
use Magento\Framework\Filesystem\Directory\WriteFactory;
12+
use Magento\Framework\Filesystem\Directory\WriteInterface;
1213

1314
/**
1415
* Class PhpStormNine generates URN catalog for PhpStorm 9
@@ -88,4 +89,4 @@ public function generateCatalog(array $dictionary, $path)
8889
$dom->formatOutput = true;
8990
$this->currentDirWrite->writeFile($path, $dom->saveXML());
9091
}
91-
}
92+
}

app/code/Magento/Developer/Test/Unit/Console/Command/XmlCatalogGenerateCommandTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ public function setUp()
2727
$filesMock->expects($this->at(1))
2828
->method('getXmlCatalogFiles')
2929
->will($this->returnValue([]));
30-
$urnResolverMock = $this->getMock('\Magento\Framework\Config\Dom\UrnResolver', [], [], '', false);
30+
$urnResolverMock = $this->getMock('\Magento\Framework\Config\Dom\UrnResolver', [], [], '', false);
3131
$urnResolverMock->expects($this->once())
3232
->method('getRealPath')
3333
->with($this->equalTo('urn:magento:framework:Module/etc/module.xsd'))
3434
->will($this->returnValue($fixtureXmlFile));
35-
$phpstormFormatMock = $this->getMock('\Magento\Developer\Model\XmlCatalog\Format\PhpStorm', [], [], '', false);
35+
$phpstormFormatMock = $this->getMock('\Magento\Developer\Model\XmlCatalog\Format\PhpStorm', [], [], '', false);
3636
$phpstormFormatMock->expects($this->once())
3737
->method('generateCatalog')
3838
->with(
@@ -41,8 +41,8 @@ public function setUp()
4141
)->will($this->returnValue(null));
4242

4343
$formats = ['phpstorm' => $phpstormFormatMock];
44-
$filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false);
45-
$readDirMock = $this->getMock('\Magento\Framework\Filesystem\Directory\ReadInterface', [], [], '', false);
44+
$filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false);
45+
$readDirMock = $this->getMock('\Magento\Framework\Filesystem\Directory\ReadInterface', [], [], '', false);
4646

4747
$content = file_get_contents($fixtureXmlFile);
4848

@@ -58,12 +58,12 @@ public function setUp()
5858
->method('getDirectoryRead')
5959
->will($this->returnValue($readDirMock));
6060

61-
$currDirMock = $this->getMock('\Magento\Framework\Filesystem\Directory\ReadInterface', [], [], '', false);
61+
$currDirMock = $this->getMock('\Magento\Framework\Filesystem\Directory\ReadInterface', [], [], '', false);
6262
$currDirMock->expects($this->once())
6363
->method('getAbsolutePath')
6464
->with($this->equalTo('test'))
6565
->will($this->returnValue('test_absolute_path'));
66-
$readDirFactory = $this->getMock('\Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false);
66+
$readDirFactory = $this->getMock('\Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false);
6767
$readDirFactory->expects($this->once())
6868
->method('create')
6969
->will($this->returnValue($currDirMock));
@@ -83,4 +83,4 @@ public function testExecuteBadType()
8383
$commandTester->execute([XmlCatalogGenerateCommand::IDE_FILE_PATH_ARGUMENT => 'test']);
8484
$this->assertEquals('', $commandTester->getDisplay());
8585
}
86-
}
86+
}

0 commit comments

Comments
 (0)