Overrides Drupal\Core\SystemListing::profiles().
Overrides SystemListing::profiles
protected function profiles($directory) {
$searchdir = array();
// The 'core/profiles' directory contains pristine collections of modules
// and themes as provided by a distribution. It is pristine in the same
// way that the 'core/modules' directory is pristine for core; users
// should avoid any modification by using the top-level or sites/<domain>
// directories.
$profile = drupal_get_profile();
// For SimpleTest to be able to test modules packaged together with a
// distribution we need to include the profile of the parent site (in
// which test runs are triggered).
if (drupal_valid_test_ua()) {
$testing_profile = config('simpletest.settings')
->get('parent_profile');
if ($testing_profile && $testing_profile != $profile) {
$searchdir[] = drupal_get_path('profile', $testing_profile) . '/' . $directory;
}
}
// In case both profile directories contain the same extension, the actual
// profile always has precedence.
$searchdir[] = drupal_get_path('profile', $profile) . '/' . $directory;
return $searchdir;
}