3 namespace Drupal\Tests\metatag\Kernel;
5 use Drupal\KernelTests\KernelTestBase;
8 * Test the Metatag Manager class.
12 class MetatagManagerTest extends KernelTestBase {
17 public static $modules = [
23 * Test the order of the meta tags as they are output.
25 public function testMetatagOrder() {
26 /** @var \Drupal\metatag\MetatagManager $metatag_manager */
27 $metatag_manager = \Drupal::service('metatag.manager');
29 $tags = $metatag_manager->generateElements([
30 'og_image_width' => 100,
31 'og_image_height' => 100,
32 'og_image_url' => 'http://www.example.com/example/foo.png',
36 '#attached' => ['html_head' => [
41 'property' => 'og:image:url',
42 'content' => 'http://www.example.com/example/foo.png',
51 'property' => 'og:image:width',
61 'property' => 'og:image:height',
69 $this->assertEquals($expected, $tags);