Currently, when specifying the DRUPAL_TESTING_DRUPAL_VERSION var, we set drupal/core and drupal/core-recommended.
Some projects might not contain drupal/core-recommended or drupal/core. Before setting the dependency, we should check which dependency is used in the current project and only set that one.