Skip to content

Commit c93b2d5

Browse files
committed
Merge branch 'develop' of https://github.com/magento/magento2-functional-testing-framework into guzzle6transport-removal
2 parents 1ed0a11 + 9279c62 commit c93b2d5

File tree

76 files changed

+230
-224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+230
-224
lines changed

dev/tests/static/Magento/Sniffs/NamingConventions/InterfaceNameSniff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ public function process(File $sourceFile, $stackPtr)
2929
$declarationLine = $tokens[$stackPtr]['line'];
3030
$suffixLength = strlen(self::INTERFACE_SUFFIX);
3131
// Find first T_STRING after 'interface' keyword in the line and verify it
32-
while ($tokens[$stackPtr]['line'] == $declarationLine) {
33-
if ($tokens[$stackPtr]['type'] == 'T_STRING') {
34-
if (substr($tokens[$stackPtr]['content'], 0 - $suffixLength) != self::INTERFACE_SUFFIX) {
32+
while ($tokens[$stackPtr]['line'] === $declarationLine) {
33+
if ($tokens[$stackPtr]['type'] === 'T_STRING') {
34+
if (substr($tokens[$stackPtr]['content'], 0 - $suffixLength) !== self::INTERFACE_SUFFIX) {
3535
$sourceFile->addError(
3636
'Interface should have name that ends with "Interface" suffix.',
3737
$stackPtr,

dev/tests/unit/Magento/FunctionalTestFramework/DataGenerator/Persist/OperationDataArrayResolverTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,15 +306,15 @@ public function testNestedMetadataArrayOfValue(): void
306306
$callback = function ($name) {
307307
$entityDataObjectBuilder = new EntityDataObjectBuilder();
308308

309-
if ($name == 'childObject1') {
309+
if ($name === 'childObject1') {
310310
return $entityDataObjectBuilder
311311
->withName('childObject1')
312312
->withType('childType')
313313
->withDataFields(['city' => 'Hawkins', 'state' => 'Indiana', 'zip' => '78758'])
314314
->build();
315315
};
316316

317-
if ($name == 'childObject2') {
317+
if ($name === 'childObject2') {
318318
return $entityDataObjectBuilder
319319
->withName('childObject2')
320320
->withType('childType')

dev/tests/unit/Magento/FunctionalTestFramework/Suite/Handlers/SuiteObjectHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ private function setMockTestAndSuiteParserOutput(array $testData, array $suiteDa
113113
->will(
114114
$this->returnCallback(
115115
function ($clazz) use ($mockDataParser, $mockSuiteDataParser) {
116-
if ($clazz == TestDataParser::class) {
116+
if ($clazz === TestDataParser::class) {
117117
return $mockDataParser;
118118
}
119119

120-
if ($clazz == SuiteDataParser::class) {
120+
if ($clazz === SuiteDataParser::class) {
121121
return $mockSuiteDataParser;
122122
}
123123

dev/tests/unit/Magento/FunctionalTestFramework/Suite/SuiteGeneratorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,13 @@ function (
347347
$mockGroupClass,
348348
$objectManager
349349
) {
350-
if ($class == TestDataParser::class) {
350+
if ($class === TestDataParser::class) {
351351
return $mockDataParser;
352352
}
353-
if ($class == SuiteDataParser::class) {
353+
if ($class === SuiteDataParser::class) {
354354
return $mockSuiteDataParser;
355355
}
356-
if ($class == GroupClassGenerator::class) {
356+
if ($class === GroupClassGenerator::class) {
357357
return $mockGroupClass;
358358
}
359359

dev/tests/unit/Magento/FunctionalTestFramework/Test/Objects/ActionGroupObjectTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testGetStepsWithDefaultCase(): void
6161
public function testGetStepsWithCustomArgs(): void
6262
{
6363
$this->setEntityObjectHandlerReturn(function ($entityName) {
64-
if ($entityName == "data2") {
64+
if ($entityName === 'data2') {
6565
return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();
6666
}
6767
});
@@ -128,7 +128,7 @@ public function testGetStepsWithPersistedArgs(): void
128128
public function testGetStepsWithNoFieldArg(): void
129129
{
130130
$this->setEntityObjectHandlerReturn(function ($entityName) {
131-
if ($entityName == "data2") {
131+
if ($entityName === 'data2') {
132132
return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();
133133
}
134134
});
@@ -151,7 +151,7 @@ public function testGetStepsWithNoFieldArg(): void
151151
public function testGetStepsWithNoArgs(): void
152152
{
153153
$this->setEntityObjectHandlerReturn(function ($entityName) {
154-
if ($entityName == "data1") {
154+
if ($entityName === 'data1') {
155155
return (new EntityDataObjectBuilder())->withDataFields(['field1' => 'testValue'])->build();
156156
}
157157
});
@@ -174,7 +174,7 @@ public function testGetStepsWithParameterizedArg(): void
174174
{
175175
// Mock Entity Object Handler
176176
$this->setEntityObjectHandlerReturn(function ($entityName) {
177-
if ($entityName == "data2") {
177+
if ($entityName === 'data2') {
178178
return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();
179179
}
180180
});
@@ -216,7 +216,7 @@ public function testGetStepsWithParameterizedSimpleArg(): void
216216
{
217217
// Mock Entity Object Handler
218218
$this->setEntityObjectHandlerReturn(function ($entityName) {
219-
if ($entityName == "data2") {
219+
if ($entityName === 'data2') {
220220
return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();
221221
}
222222
});

dev/tests/unit/Util/SuiteDataArrayBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ private function appendEntriesToSuiteContents($currentContents, $type, $contents
181181
*/
182182
public function withAfterHook($afterHook = null)
183183
{
184-
if ($afterHook == null) {
184+
if ($afterHook === null) {
185185
$this->afterHook = [$this->testActionAfterName => [
186186
ActionObjectExtractor::NODE_NAME => $this->testActionType,
187187
ActionObjectExtractor::TEST_STEP_MERGE_KEY => $this->testActionAfterName
@@ -202,7 +202,7 @@ public function withAfterHook($afterHook = null)
202202
*/
203203
public function withBeforeHook($beforeHook = null)
204204
{
205-
if ($beforeHook == null) {
205+
if ($beforeHook === null) {
206206
$this->beforeHook = [$this->testActionBeforeName => [
207207
ActionObjectExtractor::NODE_NAME => $this->testActionType,
208208
ActionObjectExtractor::TEST_STEP_MERGE_KEY => $this->testActionBeforeName

dev/tests/unit/Util/TestDataArrayBuilder.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function withName($name)
109109
*/
110110
public function withAnnotations($annotations = null)
111111
{
112-
if ($annotations == null) {
112+
if ($annotations === null) {
113113
$this->annotations = ['group' => [['value' => 'test']]];
114114
} else {
115115
$this->annotations = $annotations;
@@ -126,7 +126,7 @@ public function withAnnotations($annotations = null)
126126
*/
127127
public function withBeforeHook($beforeHook = null)
128128
{
129-
if ($beforeHook == null) {
129+
if ($beforeHook === null) {
130130
$this->beforeHook = [$this->testActionBeforeName => [
131131
ActionObjectExtractor::NODE_NAME => $this->testActionType,
132132
ActionObjectExtractor::TEST_STEP_MERGE_KEY => $this->testActionBeforeName
@@ -146,7 +146,7 @@ public function withBeforeHook($beforeHook = null)
146146
*/
147147
public function withAfterHook($afterHook = null)
148148
{
149-
if ($afterHook == null) {
149+
if ($afterHook === null) {
150150
$this->afterHook = [$this->testActionAfterName => [
151151
ActionObjectExtractor::NODE_NAME => $this->testActionType,
152152
ActionObjectExtractor::TEST_STEP_MERGE_KEY => $this->testActionAfterName
@@ -167,7 +167,7 @@ public function withAfterHook($afterHook = null)
167167
*/
168168
public function withFailedHook($failedHook = null)
169169
{
170-
if ($failedHook == null) {
170+
if ($failedHook === null) {
171171
$this->failedHook = [$this->testActionFailedName => [
172172
ActionObjectExtractor::NODE_NAME => $this->testActionType,
173173
ActionObjectExtractor::TEST_STEP_MERGE_KEY => $this->testActionFailedName
@@ -188,7 +188,7 @@ public function withFailedHook($failedHook = null)
188188
*/
189189
public function withTestActions($actions = null)
190190
{
191-
if ($actions == null) {
191+
if ($actions === null) {
192192
$this->testActions = [$this->testTestActionName => [
193193
ActionObjectExtractor::NODE_NAME => $this->testActionType,
194194
ActionObjectExtractor::TEST_STEP_MERGE_KEY => $this->testTestActionName
@@ -207,7 +207,7 @@ public function withTestActions($actions = null)
207207
*/
208208
public function withFileName($filename = null)
209209
{
210-
if ($filename == null) {
210+
if ($filename === null) {
211211
$this->filename =
212212
"/magento2-functional-testing-framework/dev/tests/verification/TestModule/Test/BasicFunctionalTest.xml";
213213
} else {

dev/tests/unit/Util/TestLoggingUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ private function __construct()
4040
*/
4141
public static function getInstance(): TestLoggingUtil
4242
{
43-
if (self::$instance == null) {
43+
if (self::$instance === null) {
4444
self::$instance = new TestLoggingUtil();
4545
}
4646
return self::$instance;

dev/tests/verification/Tests/ResilientGenerationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function testGenerateAllSuites()
123123
SuiteGenerator::getInstance()->generateAllSuites($testManifest);
124124

125125
foreach (SuiteTestReferences::$data as $groupName => $expectedContents) {
126-
if (substr($groupName, 0, 11) != 'NotGenerate') {
126+
if (substr($groupName, 0, 11) !== 'NotGenerate') {
127127
// Validate Yaml file updated
128128
$yml = Yaml::parse(file_get_contents(self::CONFIG_YML_FILE));
129129
$this->assertArrayHasKey($groupName, $yml['groups']);
@@ -175,7 +175,7 @@ function () use ($groupName) {
175175
);
176176
}
177177

178-
if (substr($groupName, 0, 11) != 'NotGenerate') {
178+
if (substr($groupName, 0, 11) !== 'NotGenerate') {
179179
// Validate Yaml file updated
180180
$yml = Yaml::parse(file_get_contents(self::CONFIG_YML_FILE));
181181
$this->assertArrayHasKey($groupName, $yml['groups']);
@@ -199,7 +199,7 @@ function () use ($groupName) {
199199
}
200200

201201
// Validate log message
202-
if (substr($groupName, 0, 11) != 'NotGenerate'
202+
if (substr($groupName, 0, 11) !== 'NotGenerate'
203203
&& !in_array($groupName, array_keys(self::$exceptionGrpLogs))) {
204204
$type = 'info';
205205
$message = '/suite generated/';

etc/config/command.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
// Token returned will be null if the token we passed in is invalid
2020
$tokenFromMagento = $tokenModel->loadByToken($tokenPassedIn)->getToken();
21-
if (!empty($tokenFromMagento) && ($tokenFromMagento == $tokenPassedIn)) {
21+
if (!empty($tokenFromMagento) && ($tokenFromMagento === $tokenPassedIn)) {
2222
$php = PHP_BINDIR ? PHP_BINDIR . '/php' : 'php';
2323
$magentoBinary = $php . ' -f ../../../../bin/magento';
2424
$valid = validateCommand($magentoBinary, $command);
@@ -52,7 +52,7 @@
5252

5353
$exitCode = $process->getExitCode();
5454

55-
if ($exitCode == 0 || $idleTimeout) {
55+
if ($process->isSuccessful() || $idleTimeout) {
5656
http_response_code(202);
5757
} else {
5858
http_response_code(500);

0 commit comments

Comments
 (0)