Code Duplication    Length = 9-10 lines in 3 locations

tests/Manager/GroupProcessManagerTest.php 1 location

@@ 103-112 (lines=10) @@
100
    /**
101
     * @param string $name
102
     */
103
    public static function dawdle($name)
104
    {
105
        touch(__DIR__ . "/{$name}.temp");
106
107
        for ($i = 0; $i < 5; $i++) {
108
            usleep(25000);
109
        }
110
111
        unlink(__DIR__ . "/{$name}.temp");
112
    }
113
}
114

tests/Manager/ProcessManagerTest.php 2 locations

@@ 63-71 (lines=9) @@
60
     */
61
    public function basicRulesAndTasksWork()
62
    {
63
        $task1 = new ProcessCallbackTask(function () {
64
            touch(__DIR__."/task1.temp");
65
66
            for ($i = 0; $i < 10; $i++) {
67
                usleep(50000);
68
            }
69
70
            unlink(__DIR__."/task1.temp");
71
        });
72
73
        $task2 = new ProcessCallbackTask(function () {
74
            touch(__DIR__."/task2.temp");
@@ 73-81 (lines=9) @@
70
            unlink(__DIR__."/task1.temp");
71
        });
72
73
        $task2 = new ProcessCallbackTask(function () {
74
            touch(__DIR__."/task2.temp");
75
76
            for ($i = 0; $i < 10; $i++) {
77
                usleep(50000);
78
            }
79
80
            unlink(__DIR__."/task2.temp");
81
        });
82
83
        $rule = new InMemoryRule();
84
        $rule->setProcesses(1);