Skip to content

Commit 795a005

Browse files
committed
Added Static Test
1 parent ec4b9b5 commit 795a005

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

Diff for: Magento2/Tests/PHP/ArrayAutovivificationUnitTest.inc

+40
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,44 @@ class Avtovivification
5757

5858
return $productIds;
5959
}
60+
61+
/**
62+
* @return array
63+
*/
64+
public function testAvtovivification($testData)
65+
{
66+
$productIds = false !== $testData ? $testData : null;
67+
68+
$productIds[] = 'test_array_value';
69+
70+
return $productIds;
71+
}
72+
73+
/**
74+
* @param array $productIds
75+
*
76+
* @return array
77+
*/
78+
public function testWithParameterArray($productIds)
79+
{
80+
if (!empty($productIds['test_array_key'])) {
81+
$productIds['test_array_key'] = 'test_array_value';
82+
}
83+
84+
return $productIds;
85+
}
86+
87+
/**
88+
* @param false|array $productIds
89+
*
90+
* @return false|array
91+
*/
92+
public function testWithParameterFalse($productIds = false)
93+
{
94+
if ($productIds !== false) {
95+
$productIds[] = 'test_array_value';
96+
}
97+
98+
return $productIds;
99+
}
60100
}

0 commit comments

Comments
 (0)