X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Ftests%2FDrupal%2FTests%2FComponent%2FAnnotation%2FPluginIdTest.php;fp=web%2Fcore%2Ftests%2FDrupal%2FTests%2FComponent%2FAnnotation%2FPluginIdTest.php;h=f115de34f1186592566d3a82ac18a2d63c9bbb8d;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/core/tests/Drupal/Tests/Component/Annotation/PluginIdTest.php b/web/core/tests/Drupal/Tests/Component/Annotation/PluginIdTest.php new file mode 100644 index 000000000..f115de34f --- /dev/null +++ b/web/core/tests/Drupal/Tests/Component/Annotation/PluginIdTest.php @@ -0,0 +1,55 @@ + 'bar', + 'biz' => [ + 'baz' => 'boom', + ], + 'nestedAnnotation' => new PluginID([ + 'foo' => 'bar', + ]), + 'value' => 'biz', + ]); + $this->assertEquals([ + 'id' => NULL, + 'class' => NULL, + 'provider' => NULL, + ], $plugin->get()); + + // Set values and ensure we can retrieve them. + $plugin->value = 'foo'; + $plugin->setClass('bar'); + $plugin->setProvider('baz'); + $this->assertEquals([ + 'id' => 'foo', + 'class' => 'bar', + 'provider' => 'baz', + ], $plugin->get()); + } + + /** + * @covers ::getId + */ + public function testGetId() { + $plugin = new PluginID([]); + $plugin->value = 'example'; + $this->assertEquals('example', $plugin->getId()); + } + +}