YamlFormTemplatesTest.php in YAML Form 8
File
modules/yamlform_templates/src/Tests/YamlFormTemplatesTest.php
View source
<?php
namespace Drupal\yamlform_templates\Tests;
use Drupal\yamlform\Entity\YamlForm;
use Drupal\yamlform\Tests\YamlFormTestBase;
class YamlFormTemplatesTest extends YamlFormTestBase {
public static $modules = [
'system',
'block',
'node',
'user',
'yamlform',
'yamlform_test',
'yamlform_templates',
];
public function testSettings() {
$template_yamlform = YamlForm::load('test_form_template');
$this
->assertTrue($template_yamlform
->isClosed());
$template_yamlform
->setStatus(TRUE)
->save();
$this
->assertTrue($template_yamlform
->isClosed());
$this
->drupalLogin($this->ownFormUser);
$this
->drupalGet('admin/structure/yamlform/templates');
$this
->assertRaw('Test: Form: Template');
$this
->assertRaw('Test using a form as a template.');
$this
->drupalGet('yamlform/test_form_template');
$this
->assertResponse(200);
$this
->assertRaw('You are previewing the below template,');
$this
->drupalLogin($this->adminFormUser);
}
}