Loading CHANGELOG.txt +1 −0 Original line number Diff line number Diff line Metatag 8.x-1.x-dev, xxxx-xx-xx ------------------------------- #3102937 by yasmeensalah, Berdir: Plugin AlternateHandheld is misnamed. #3103725 by thalles: Create kernel test to Form\MetatagSettingsForm. Metatag 8.x-1.11, 2019-12-20 Loading tests/src/Kernel/Form/MetatagSettingsFormTest.php 0 → 100644 +64 −0 Original line number Diff line number Diff line <?php namespace Drupal\Tests\metatag\Kernel\Form; use Drupal\Core\Form\FormInterface; use Drupal\KernelTests\KernelTestBase; use Drupal\metatag\Form\MetatagSettingsForm; /** * Tests the metatag settings form. * * @coversDefaultClass \Drupal\metatag\Form\MetatagSettingsForm * * @group metatag */ class MetatagSettingsFormTest extends KernelTestBase { /** * The metatag form object under test. * * @var \Drupal\metatag\Form\MetatagSettingsForm */ protected $metatagSettingsForm; /** * Modules to enable. * * @var array */ public static $modules = [ 'system', 'metatag', ]; /** * {@inheritdoc} * * @covers ::__construct */ protected function setUp() { parent::setUp(); $this->installConfig(static::$modules); $this->metatagSettingsForm = new MetatagSettingsForm( $this->container->get('config.factory') ); } /** * Tests for \Drupal\metatag\Form\MetatagSettingsForm. */ public function testMetatagSettingsForm() { $this->assertInstanceOf(FormInterface::class, $this->metatagSettingsForm); $this->assertEquals('metatag_admin_settings', $this->metatagSettingsForm->getFormId()); $method = new \ReflectionMethod(MetatagSettingsForm::class, 'getEditableConfigNames'); $method->setAccessible(TRUE); $name = $method->invoke($this->metatagSettingsForm); $this->assertEquals(['metatag.settings'], $name); } } Loading
CHANGELOG.txt +1 −0 Original line number Diff line number Diff line Metatag 8.x-1.x-dev, xxxx-xx-xx ------------------------------- #3102937 by yasmeensalah, Berdir: Plugin AlternateHandheld is misnamed. #3103725 by thalles: Create kernel test to Form\MetatagSettingsForm. Metatag 8.x-1.11, 2019-12-20 Loading
tests/src/Kernel/Form/MetatagSettingsFormTest.php 0 → 100644 +64 −0 Original line number Diff line number Diff line <?php namespace Drupal\Tests\metatag\Kernel\Form; use Drupal\Core\Form\FormInterface; use Drupal\KernelTests\KernelTestBase; use Drupal\metatag\Form\MetatagSettingsForm; /** * Tests the metatag settings form. * * @coversDefaultClass \Drupal\metatag\Form\MetatagSettingsForm * * @group metatag */ class MetatagSettingsFormTest extends KernelTestBase { /** * The metatag form object under test. * * @var \Drupal\metatag\Form\MetatagSettingsForm */ protected $metatagSettingsForm; /** * Modules to enable. * * @var array */ public static $modules = [ 'system', 'metatag', ]; /** * {@inheritdoc} * * @covers ::__construct */ protected function setUp() { parent::setUp(); $this->installConfig(static::$modules); $this->metatagSettingsForm = new MetatagSettingsForm( $this->container->get('config.factory') ); } /** * Tests for \Drupal\metatag\Form\MetatagSettingsForm. */ public function testMetatagSettingsForm() { $this->assertInstanceOf(FormInterface::class, $this->metatagSettingsForm); $this->assertEquals('metatag_admin_settings', $this->metatagSettingsForm->getFormId()); $method = new \ReflectionMethod(MetatagSettingsForm::class, 'getEditableConfigNames'); $method->setAccessible(TRUE); $name = $method->invoke($this->metatagSettingsForm); $this->assertEquals(['metatag.settings'], $name); } }