Skip to content

Commit fcc50b9

Browse files
authored
[CodeQuality] Add failing fixture crash ArrayItem as Foreach_ value on DirectInstanceOverMockArgRector (#616)
* [CodeQuality] Add failing fixture crash ArrayItem as Foreach_ value * Trigger CI for get latest rector-src
1 parent 4297dc5 commit fcc50b9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\CallLike\DirectInstanceOverMockArgRector\Fixture;
4+
5+
use PHPUnit\Framework\TestCase;
6+
7+
final class SomeCrashArray extends TestCase
8+
{
9+
private const array TIME_UNITS = [
10+
['weeks', 604800],
11+
['days', 86400],
12+
['hours', 3600],
13+
['minutes', 60],
14+
['seconds', 1],
15+
];
16+
17+
public function testThat($product)
18+
{
19+
foreach (self::TIME_UNITS as [$unit, $seconds]) {
20+
if ($product % $seconds === 0) {
21+
return [
22+
'unit' => (string) $unit,
23+
'value' => (int) ($product / $seconds),
24+
];
25+
}
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)