Initial Drupal 11 with DDEV setup
This commit is contained in:
34
web/core/tests/fixtures/plugins/CustomPlugin.php
vendored
Normal file
34
web/core/tests/fixtures/plugins/CustomPlugin.php
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace com\example\PluginNamespace;
|
||||
|
||||
use Drupal\Component\Plugin\Attribute\Plugin;
|
||||
|
||||
/**
|
||||
* Custom plugin attribute.
|
||||
*/
|
||||
#[\Attribute(\Attribute::TARGET_CLASS)]
|
||||
class CustomPlugin extends Plugin {
|
||||
|
||||
/**
|
||||
* Constructs a CustomPlugin attribute object.
|
||||
*
|
||||
* @param string $id
|
||||
* The attribute class ID.
|
||||
* @param string $title
|
||||
* The title.
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $id,
|
||||
public readonly string $title,
|
||||
) {}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom plugin attribute.
|
||||
*/
|
||||
#[\Attribute(\Attribute::TARGET_CLASS)]
|
||||
class CustomPlugin2 extends Plugin {}
|
||||
19
web/core/tests/fixtures/plugins/Plugin/PluginNamespace/AttributeDiscoveryTest1.php
vendored
Normal file
19
web/core/tests/fixtures/plugins/Plugin/PluginNamespace/AttributeDiscoveryTest1.php
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace com\example\PluginNamespace;
|
||||
|
||||
use Drupal\Component\Plugin\Attribute\Plugin;
|
||||
|
||||
/**
|
||||
* Provides a custom test plugin.
|
||||
*/
|
||||
#[Plugin(
|
||||
id: "discovery_test_1",
|
||||
)]
|
||||
#[CustomPlugin(
|
||||
id: "discovery_test_1",
|
||||
title: "Discovery test plugin"
|
||||
)]
|
||||
class AttributeDiscoveryTest1 {}
|
||||
16
web/core/tests/fixtures/plugins/Plugin/PluginNamespace/AttributeDiscoveryTest2.php
vendored
Normal file
16
web/core/tests/fixtures/plugins/Plugin/PluginNamespace/AttributeDiscoveryTest2.php
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace com\example\PluginNamespace;
|
||||
|
||||
use Drupal\a_module_that_does_not_exist\Plugin\Custom;
|
||||
|
||||
/**
|
||||
* Provides a custom test plugin that extends from a missing dependency.
|
||||
*/
|
||||
#[CustomPlugin(
|
||||
id: "discovery_test_2",
|
||||
title: "Discovery test plugin 2"
|
||||
)]
|
||||
class AttributeDiscoveryTest2 extends Custom {}
|
||||
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace com\example\PluginNamespace;
|
||||
|
||||
use Drupal\a_module_that_does_not_exist\Plugin\CustomInterface;
|
||||
|
||||
/**
|
||||
* Provides a custom test plugin that implements a missing interface.
|
||||
*/
|
||||
#[CustomPlugin(
|
||||
id: "discovery_test_missing_interface",
|
||||
title: "Discovery test plugin missing interface"
|
||||
)]
|
||||
class AttributeDiscoveryTestMissingInterface implements CustomInterface {}
|
||||
19
web/core/tests/fixtures/plugins/Plugin/PluginNamespace/AttributeDiscoveryTestMissingTrait.php
vendored
Normal file
19
web/core/tests/fixtures/plugins/Plugin/PluginNamespace/AttributeDiscoveryTestMissingTrait.php
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace com\example\PluginNamespace;
|
||||
|
||||
use Drupal\a_module_that_does_not_exist\Plugin\CustomTrait;
|
||||
|
||||
/**
|
||||
* Provides a custom test plugin that uses a missing trait.
|
||||
*/
|
||||
#[CustomPlugin(
|
||||
id: "discovery_test_missing_trait",
|
||||
title: "Discovery test plugin missing trait"
|
||||
)]
|
||||
class AttributeDiscoveryTestMissingTrait {
|
||||
use CustomTrait;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user