Skip to content

Commit f823916

Browse files
author
Yurii Torbyk
committed
MAGETWO-35561: Stabilize story
1 parent 680a482 commit f823916

File tree

6 files changed

+12
-22
lines changed

6 files changed

+12
-22
lines changed

app/code/Magento/Eav/Model/Entity/AbstractEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ public function walkAttributes($partMethod, array $args = [], $collectExceptionM
733733
/** @var \Magento\Eav\Model\Entity\Attribute\Exception $e */
734734
$e = $this->_universalFactory->create(
735735
'Magento\Eav\Model\Entity\Attribute\Exception',
736-
['message' => __($e->getMessage())]
736+
['phrase' => __($e->getMessage())]
737737
);
738738
$e->setAttributeCode($attrCode)->setPart($part);
739739
throw $e;

app/code/Magento/Payment/Test/Unit/Block/Info/CcTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ public function ccExpMonthDataProvider()
131131
*/
132132
public function testGetCcExpDate($ccExpMonth, $ccExpYear)
133133
{
134-
$this->markTestIncomplete('Failing on the develop branch');
135-
136134
$paymentInfo = $this->getMock('Magento\Payment\Model\Info', ['getCcExpMonth', 'getCcExpYear'], [], '', false);
137135
$paymentInfo
138136
->expects($this->any())
@@ -159,7 +157,7 @@ public function testGetCcExpDate($ccExpMonth, $ccExpYear)
159157
public function getCcExpDateDataProvider()
160158
{
161159
return [
162-
[2, 2015],
160+
[3, 2015],
163161
[12, 2011],
164162
[01, 2036]
165163
];

dev/tests/integration/framework/Magento/TestFramework/Helper/Memory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function getRealMemoryUsage()
5050
// try to use the Windows command line
5151
// some ports of Unix commands on Windows, such as MinGW, have limited capabilities and cannot be used
5252
$result = $this->_getWinProcessMemoryUsage($pid);
53-
} catch (\Magento\Framework\Exception\LocalizedException $e) {
53+
} catch (\Exception $e) {
5454
// fall back to the Unix command line
5555
$result = $this->_getUnixProcessMemoryUsage($pid);
5656
}

dev/tests/integration/testsuite/Magento/Reports/Model/Resource/Report/Product/Viewed/CollectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function tableForPeriodDataProvider()
121121
],
122122
[
123123
'period' => 'month',
124-
'table' => 'report_viewed_product_aggregated_yearly',
124+
'table' => 'report_viewed_product_aggregated_monthly',
125125
'date_from' => null,
126126
'date_to' => $dateNow,
127127
],

lib/internal/Magento/Framework/Code/Generator.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function getGeneratedEntities()
6969
*
7070
* @param string $className
7171
* @return string
72-
* @throws \Magento\Framework\Exception\LocalizedException
72+
* @throws \Exception
7373
* @throws \InvalidArgumentException
7474
*/
7575
public function generateClass($className)
@@ -102,9 +102,7 @@ public function generateClass($className)
102102
$this->tryToLoadSourceClass($className, $generator);
103103
if (!($file = $generator->generate())) {
104104
$errors = $generator->getErrors();
105-
throw new \Magento\Framework\Exception\LocalizedException(
106-
new \Magento\Framework\Phrase(implode(' ', $errors))
107-
);
105+
throw new \Exception(implode(' ', $errors));
108106
}
109107
$this->includeFile($file);
110108
return self::GENERATION_SUCCESS;
@@ -169,18 +167,15 @@ public function getObjectManager()
169167
* @param string $className
170168
* @param \Magento\Framework\Code\Generator\EntityAbstract $generator
171169
* @return void
172-
* @throws \Magento\Framework\Exception\LocalizedException
170+
* @throws \Exception
173171
*/
174172
protected function tryToLoadSourceClass($className, $generator)
175173
{
176174
$sourceClassName = $generator->getSourceClassName();
177175
if (!$this->definedClasses->classLoadable($sourceClassName)) {
178176
if ($this->generateClass($sourceClassName) !== self::GENERATION_SUCCESS) {
179-
throw new \Magento\Framework\Exception\LocalizedException(
180-
new \Magento\Framework\Phrase(
181-
'Source class "%1" for "%2" generation does not exist.',
182-
[$sourceClassName, $className]
183-
)
177+
throw new \Exception(
178+
sprintf('Source class "%s" for "%s" generation does not exist.', $sourceClassName, $className)
184179
);
185180
}
186181
}

lib/internal/Magento/Framework/Shell.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(
4242
* @param string $command Command with optional argument markers '%s'
4343
* @param string[] $arguments Argument values to substitute markers with
4444
* @return string Output of an executed command
45-
* @throws \Magento\Framework\Exception\LocalizedException If a command returns non-zero exit code
45+
* @throws \Exception If a command returns non-zero exit code
4646
*/
4747
public function execute($command, array $arguments = [])
4848
{
@@ -51,18 +51,15 @@ public function execute($command, array $arguments = [])
5151

5252
$disabled = explode(',', ini_get('disable_functions'));
5353
if (in_array('exec', $disabled)) {
54-
throw new Exception\LocalizedException(new \Magento\Framework\Phrase("exec function is disabled."));
54+
throw new \Exception("exec function is disabled.");
5555
}
5656

5757
exec($command, $output, $exitCode);
5858
$output = implode(PHP_EOL, $output);
5959
$this->log($output);
6060
if ($exitCode) {
6161
$commandError = new \Exception($output, $exitCode);
62-
throw new Exception\LocalizedException(
63-
new \Magento\Framework\Phrase("Command returned non-zero exit code:\n`%1`", [$command]),
64-
$commandError
65-
);
62+
throw new \Exception("Command returned non-zero exit code:\n`{$command}`", 0, $commandError);
6663
}
6764
return $output;
6865
}

0 commit comments

Comments
 (0)