MetatagSettingsFormTest.php in Metatag 8
File
tests/src/Kernel/Form/MetatagSettingsFormTest.php
View source
<?php
namespace Drupal\Tests\metatag\Kernel\Form;
use Drupal\Core\Form\FormInterface;
use Drupal\KernelTests\KernelTestBase;
use Drupal\metatag\Form\MetatagSettingsForm;
class MetatagSettingsFormTest extends KernelTestBase {
protected $metatagSettingsForm;
protected static $modules = [
'system',
'token',
'metatag',
];
protected function setUp() {
parent::setUp();
$this
->installConfig(static::$modules);
$this->metatagSettingsForm = new MetatagSettingsForm($this->container
->get('config.factory'));
}
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);
}
}