original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: preapare test methods required order
  
  @param  array     $tests_dependencies  tests dependencies array
  @param  array     $tests_methods       tests (shuffled) array
  @return array     array
docstring_tokens: preapare test methods required order