Skip to content

Commit 6d77a26

Browse files
author
Robert He
committed
MAGETWO-31371: Improve Unit and Integration test coverage
- more fixes from review
1 parent 44293f1 commit 6d77a26

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

app/code/Magento/Tax/Test/Unit/GetterSetterTest.php

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ public function testGettersSetters($className = null, $variables = null)
2020
foreach ($variables as $variableName => $variableValue) {
2121
$setterName = 'set' . $variableName;
2222

23-
$this->assertTrue(method_exists($classObject, $setterName),
24-
"Method " . $setterName . " does not exist in " . $className);
23+
$this->assertTrue(
24+
method_exists($classObject, $setterName),
25+
"Method " . $setterName . " does not exist in " . $className
26+
);
2527

2628
if (is_array($variableValue)) {
2729
if (strpos($variableValue[0], 'Magento') !== false) {
@@ -34,25 +36,34 @@ public function testGettersSetters($className = null, $variables = null)
3436
$variableValue = $obj;
3537
$variables[$variableName] = $variableValue;
3638
}
37-
$this->assertNotFalse(call_user_func([$classObject, $setterName], $variableValue),
38-
"Calling method " . $setterName . " failed in " . $className);
39+
$this->assertNotFalse(call_user_func(
40+
[$classObject, $setterName], $variableValue),
41+
"Calling method " . $setterName . " failed in " . $className
42+
);
3943
}
4044

4145
foreach ($variables as $variableName => $variableValue) {
4246
$getterName = 'get' . $variableName;
4347

44-
$this->assertTrue(method_exists($classObject, $getterName),
45-
"Method " . $getterName . " does not exist in " . $className);
48+
$this->assertTrue(
49+
method_exists($classObject, $getterName),
50+
"Method " . $getterName . " does not exist in " . $className
51+
);
4652
$result = call_user_func([$classObject, $getterName]);
47-
$this->assertNotFalse($result,
48-
"Calling method " . $getterName . " failed in " . $className);
49-
$this->assertSame($result, $variableValue,
50-
"Value from " . $getterName . "did not match in " . $className);
53+
$this->assertNotFalse(
54+
$result,
55+
"Calling method " . $getterName . " failed in " . $className
56+
);
57+
$this->assertSame(
58+
$result, $variableValue,
59+
"Value from " . $getterName . "did not match in " . $className
60+
);
5161
}
5262
}
5363

5464
/**
5565
* @return array
66+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
5667
*/
5768
public function dataProviderGettersSetters()
5869
{

0 commit comments

Comments
 (0)