Commit 04a706f6 authored by alexpott's avatar alexpott

Issue #2309731 by bendeguz.csirmaz, phenaproxima, alexpott:...

Issue #2309731 by bendeguz.csirmaz, phenaproxima, alexpott: drupal_check_profile() does not invoke the profile's hook_requirements()
parent 7fcabc7a
......@@ -991,6 +991,12 @@ function drupal_check_profile($profile) {
}
}
// Add the profile requirements.
$function = $profile . '_requirements';
if (function_exists($function)) {
$requirements = array_merge($requirements, $function('install'));
}
return $requirements;
}
......
name: 'Testing requirements'
type: profile
description: 'Profile for testing hook_requirements().'
version: VERSION
core: 8.x
hidden: true
<?php
/**
* @file
* Install hooks for test profile.
*/
/**
* Implements hook_requirements().
*/
function testing_requirements_requirements($phase) {
$requirements = [];
if ($phase === 'install') {
$requirements['testing_requirements'] = [
'title' => t('Testing requirements'),
'severity' => REQUIREMENT_ERROR,
'description' => t('Testing requirements failed requirements.'),
];
}
return $requirements;
}
<?php
namespace Drupal\FunctionalTests\Installer;
/**
* Tests that an install profile can implement hook_requirements().
*
* @group Installer
*/
class InstallerProfileRequirementsTest extends InstallerTestBase {
/**
* {@inheritdoc}
*/
protected $profile = 'testing_requirements';
/**
* {@inheritdoc}
*/
protected function setUpSettings() {
// This form will never be reached.
}
/**
* {@inheritdoc}
*/
protected function setUpSite() {
// This form will never be reached.
}
/**
* Assert that the profile failed hook_requirements().
*/
public function testHookRequirementsFailure() {
$this->assertSession()->pageTextContains('Testing requirements failed requirements.');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment