private function setOrder($tests_dependencies, $tests_methods)
    {
        $new_order = [];
        foreach ($tests_methods as $method_name => $order) {
            if (isset($tests_dependencies[$method_name]) && !in_array($tests_dependencies[$method_name], $new_order)) {
                $new_order[] = $tests_dependencies[$method_name];
                $this->isDependant($new_order, $tests_dependencies, $tests_methods, $tests_dependencies[$method_name]);
            }

            if (!in_array($method_name, $new_order)) {
                $new_order[] = $method_name;
            }
        }

        return $new_order;
    }
private function setOrder($tests_dependencies, $tests_methods)
    {
        $new_order = [];
        foreach ($tests_methods as $method_name => $order) {
            if (isset($tests_dependencies[$method_name]) && !in_array($tests_dependencies[$method_name], $new_order)) {
                $new_order[] = $tests_dependencies[$method_name];
                $this->isDependant($new_order, $tests_dependencies, $tests_methods, $tests_dependencies[$method_name]);
            }

            if (!in_array($method_name, $new_order)) {
                $new_order[] = $method_name;
            }
        }

        return $new_order;
    }
private function setOrder ( $ tests_dependencies , $ tests_methods ) { $ new_order = [ ] ; foreach ( $ tests_methods as $ method_name => $ order ) { if ( isset ( $ tests_dependencies [ $ method_name ] ) && ! in_array ( $ tests_dependencies [ $ method_name ] , $ new_order ) ) { $ new_order [ ] = $ tests_dependencies [ $ method_name ] ; $ this -> isDependant ( $ new_order , $ tests_dependencies , $ tests_methods , $ tests_dependencies [ $ method_name ] ) ; } if ( ! in_array ( $ method_name , $ new_order ) ) { $ new_order [ ] = $ method_name ; } } return $ new_order ; }
preapare test methods required order

@param  array     $tests_dependencies  tests dependencies array
@param  array     $tests_methods       tests (shuffled) array
@return array     array
preapare test methods required order