3 namespace Drupal\Tests\Component\Annotation;
5 use Drupal\Component\Annotation\PluginID;
6 use PHPUnit\Framework\TestCase;
9 * @coversDefaultClass \Drupal\Component\Annotation\PluginId
12 class PluginIdTest extends TestCase {
17 public function testGet() {
18 // Assert plugin starts empty regardless of constructor.
19 $plugin = new PluginID([
24 'nestedAnnotation' => new PluginID([
35 // Set values and ensure we can retrieve them.
36 $plugin->value = 'foo';
37 $plugin->setClass('bar');
38 $plugin->setProvider('baz');
49 public function testGetId() {
50 $plugin = new PluginID([]);
51 $plugin->value = 'example';
52 $this->assertEquals('example', $plugin->getId());