--- /dev/null
+<?php
+
+/**
+ * @file
+ * A dummy module to test API interaction with the Toolbar module.
+ */
+
+use Drupal\Core\Url;
+
+/**
+ * Implements hook_toolbar().
+ */
+function toolbar_test_toolbar() {
+
+ $items['testing'] = [
+ '#type' => 'toolbar_item',
+ 'tab' => [
+ '#type' => 'link',
+ '#title' => t('Test tab'),
+ '#url' => Url::fromRoute('<front>'),
+ '#options' => [
+ 'attributes' => [
+ 'id' => 'toolbar-tab-testing',
+ 'title' => t('Test tab'),
+ ],
+ ],
+ ],
+ 'tray' => [
+ '#heading' => t('Test tray'),
+ '#wrapper_attributes' => [
+ 'id' => 'toolbar-tray-testing',
+ ],
+ 'content' => [
+ '#theme' => 'item_list',
+ '#items' => [
+ \Drupal::l(t('link 1'), new Url('<front>', [], ['attributes' => ['title' => 'Test link 1 title']])),
+ \Drupal::l(t('link 2'), new Url('<front>', [], ['attributes' => ['title' => 'Test link 2 title']])),
+ \Drupal::l(t('link 3'), new Url('<front>', [], ['attributes' => ['title' => 'Test link 3 title']])),
+ ],
+ '#attributes' => [
+ 'class' => ['toolbar-menu'],
+ ],
+ ],
+ ],
+ '#weight' => 50,
+ ];
+
+ return $items;
+}