Initial Drupal 11 with DDEV setup
This commit is contained in:
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\testing_hooks\Hook;
|
||||
|
||||
use Drupal\Core\Hook\Attribute\Hook;
|
||||
|
||||
/**
|
||||
* Hook implementation on behalf of another module.
|
||||
*/
|
||||
class TestingHooksProfile {
|
||||
|
||||
/**
|
||||
* Implements hook_cache_flush().
|
||||
*/
|
||||
#[Hook('cache_flush')]
|
||||
public function flush(): void {
|
||||
// Set a global value we can check in test code.
|
||||
$GLOBALS['profile_oop'] = 'profile_oop';
|
||||
}
|
||||
|
||||
}
|
||||
10
web/core/profiles/tests/testing_hooks/testing_hooks.info.yml
Normal file
10
web/core/profiles/tests/testing_hooks/testing_hooks.info.yml
Normal file
@ -0,0 +1,10 @@
|
||||
name: Testing Hooks in profile
|
||||
type: profile
|
||||
description: 'Minimal profile for running tests. Includes absolutely required modules only.'
|
||||
version: VERSION
|
||||
hidden: true
|
||||
install:
|
||||
# Enable page_cache and dynamic_page_cache in testing, to ensure that as many
|
||||
# tests as possible run with them enabled.
|
||||
- drupal:page_cache
|
||||
- dynamic_page_cache
|
||||
18
web/core/profiles/tests/testing_hooks/testing_hooks.profile
Normal file
18
web/core/profiles/tests/testing_hooks/testing_hooks.profile
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Implement hooks.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This implements cache_flush.
|
||||
*
|
||||
* We do not have implements so this does not get converted.
|
||||
*/
|
||||
function testing_hooks_cache_flush(): void {
|
||||
// Set a global value we can check in test code.
|
||||
$GLOBALS['profile_procedural'] = 'profile_procedural';
|
||||
}
|
||||
Reference in New Issue
Block a user