Skip to content

Commit 88b6750

Browse files
author
Stanislav Idolov
committed
magento-partners/magento2ce#2543: Fixed static test failures
1 parent 96a0df1 commit 88b6750

File tree

5 files changed

+59
-21
lines changed

5 files changed

+59
-21
lines changed

app/code/Magento/Customer/Model/Config/Backend/Address/Street.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ public function afterDelete()
9797
break;
9898

9999
case ScopeConfigInterface::SCOPE_TYPE_DEFAULT:
100-
$attribute->setData('multiline_count', 2);
101-
break;
100+
$attribute->setData('multiline_count', 2);
101+
break;
102102
}
103103
$attribute->save();
104104
return $result;

app/code/Magento/Translation/Block/Js.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
use Magento\Translation\Model\Js\Config;
1111

1212
/**
13+
* JS translation block
14+
*
1315
* @api
1416
* @since 100.0.2
1517
*/
@@ -53,7 +55,7 @@ public function dictionaryEnabled()
5355
}
5456

5557
/**
56-
* gets current js-translation.json timestamp
58+
* Gets current js-translation.json timestamp
5759
*
5860
* @return string
5961
*/
@@ -63,6 +65,8 @@ public function getTranslationFileTimestamp()
6365
}
6466

6567
/**
68+
* Get translation file path
69+
*
6670
* @return string
6771
*/
6872
public function getTranslationFilePath()

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ public function __construct(
5858
}
5959

6060
/**
61-
* Check that the RabbitMQ instance has the management plugin installed and the api
62-
* is available.
61+
* Check that the RabbitMQ instance has the management plugin installed and the api is available.
6362
*
6463
* @return bool
6564
*/
@@ -92,6 +91,7 @@ public function getExchanges()
9291
/**
9392
* Get declared exchange bindings.
9493
*
94+
* @param string $name
9595
* @return array
9696
*/
9797
public function getExchangeBindings($name)
@@ -119,6 +119,8 @@ public function getConnections()
119119
}
120120

121121
/**
122+
* Clear Queue
123+
*
122124
* @param string $name
123125
* @param int $numMessages
124126
* @return string
@@ -138,7 +140,7 @@ public function clearQueue(string $name, int $numMessages = 50)
138140
/**
139141
* Delete connection
140142
*
141-
* @param $name
143+
* @param string $name
142144
* @return string $data
143145
*/
144146
public function deleteConnection($name)

dev/tests/integration/framework/Magento/TestFramework/MessageQueue/PublisherConsumerController.php

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
use Magento\Framework\OsInfo;
1313
use Magento\TestFramework\Helper\Amqp;
1414

15+
/**
16+
* Publisher Consumer Controller
17+
*/
1518
class PublisherConsumerController
1619
{
1720
/**
@@ -49,6 +52,16 @@ class PublisherConsumerController
4952
*/
5053
private $amqpHelper;
5154

55+
/**
56+
* PublisherConsumerController constructor.
57+
* @param PublisherInterface $publisher
58+
* @param OsInfo $osInfo
59+
* @param Amqp $amqpHelper
60+
* @param string $logFilePath
61+
* @param array $consumers
62+
* @param array $appInitParams
63+
* @param null|int $maxMessages
64+
*/
5265
public function __construct(
5366
PublisherInterface $publisher,
5467
OsInfo $osInfo,
@@ -75,17 +88,7 @@ public function __construct(
7588
*/
7689
public function initialize()
7790
{
78-
if ($this->osInfo->isWindows()) {
79-
throw new EnvironmentPreconditionException(
80-
"This test relies on *nix shell and should be skipped in Windows environment."
81-
);
82-
}
83-
84-
if (!$this->amqpHelper->isAvailable()) {
85-
throw new PreconditionFailedException(
86-
'This test relies on RabbitMQ Management Plugin.'
87-
);
88-
}
91+
$this->validateEnvironmentPreconditions();
8992

9093
$connections = $this->amqpHelper->getConnections();
9194
foreach (array_keys($connections) as $connectionName) {
@@ -115,6 +118,27 @@ public function initialize()
115118
}
116119
}
117120

121+
/**
122+
* Validate environment preconditions
123+
*
124+
* @throws EnvironmentPreconditionException
125+
* @throws PreconditionFailedException
126+
*/
127+
private function validateEnvironmentPreconditions()
128+
{
129+
if ($this->osInfo->isWindows()) {
130+
throw new EnvironmentPreconditionException(
131+
"This test relies on *nix shell and should be skipped in Windows environment."
132+
);
133+
}
134+
135+
if (!$this->amqpHelper->isAvailable()) {
136+
throw new PreconditionFailedException(
137+
'This test relies on RabbitMQ Management Plugin.'
138+
);
139+
}
140+
}
141+
118142
/**
119143
* Stop Consumers
120144
*/
@@ -128,6 +152,8 @@ public function stopConsumers()
128152
}
129153

130154
/**
155+
* Get Consumers ProcessIds
156+
*
131157
* @return array
132158
*/
133159
public function getConsumersProcessIds()
@@ -140,6 +166,8 @@ public function getConsumersProcessIds()
140166
}
141167

142168
/**
169+
* Get Consumer ProcessIds
170+
*
143171
* @param string $consumer
144172
* @return string[]
145173
*/
@@ -174,8 +202,10 @@ private function getConsumerStartCommand($consumer, $withEnvVariables = false)
174202
}
175203

176204
/**
205+
* Wait for asynchronous result
206+
*
177207
* @param callable $condition
178-
* @param $params
208+
* @param array $params
179209
* @throws PreconditionFailedException
180210
*/
181211
public function waitForAsynchronousResult(callable $condition, $params)
@@ -192,6 +222,8 @@ public function waitForAsynchronousResult(callable $condition, $params)
192222
}
193223

194224
/**
225+
* Get publisher
226+
*
195227
* @return PublisherInterface
196228
*/
197229
public function getPublisher()

lib/internal/Magento/Framework/Reflection/TypeProcessor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ public function getAliasMapping(ClassReflection $sourceClass): array
562562
/**
563563
* Return true if the passed type is a simple type
564564
*
565-
* eg.:
565+
* Eg.:
566566
* Return true with; array, string, ...
567567
* Return false with: SomeClassName
568568
*
@@ -577,7 +577,7 @@ public function isSimpleType(string $typeName): bool
577577
/**
578578
* Get basic type for a class name
579579
*
580-
* eg.:
580+
* Eg.:
581581
* SomeClassName[] => SomeClassName
582582
*
583583
* @param string $className
@@ -592,7 +592,7 @@ public function getBasicClassName(string $className): string
592592
/**
593593
* Return true if it is a FQ class name
594594
*
595-
* eg.:
595+
* Eg.:
596596
* SomeClassName => false
597597
* \My\NameSpace\SomeClassName => true
598598
*

0 commit comments

Comments
 (0)