YamlFormElementPluginTest.php in YAML Form 8
File
src/Tests/YamlFormElementPluginTest.php
View source
<?php
namespace Drupal\yamlform\Tests;
use Drupal\yamlform\Entity\YamlForm;
use Drupal\yamlform\Entity\YamlFormSubmission;
class YamlFormElementPluginTest extends YamlFormTestBase {
public function testYamlFormElement() {
$this
->drupalLogin($this->adminFormUser);
$yamlform_plugin_test = YamlForm::load('test_element_plugin_test');
$this
->drupalGet('yamlform/test_element_plugin_test');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:preCreate');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:postCreate');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:prepare');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:setDefaultValue');
$sid = $this
->postSubmission($yamlform_plugin_test);
$yamlform_submission = YamlFormSubmission::load($sid);
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:preCreate');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:prepare');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:setDefaultValue');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest::validate');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:preSave');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:postSave insert');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:postLoad');
$this
->drupalPostForm('/admin/structure/yamlform/manage/test_element_plugin_test/submission/' . $sid . '/edit', [], t('Save'));
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:postLoad');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:prepare');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:setDefaultValue');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest::validate');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:preSave');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:postSave update');
$this
->drupalGet('/admin/structure/yamlform/manage/test_element_plugin_test/submission/' . $sid);
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:postLoad');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:formatHtml');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:formatText');
$this
->drupalGet('/admin/structure/yamlform/manage/test_element_plugin_test/submission/' . $sid . '/text');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:postLoad');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:formatText');
$this
->drupalPostForm('/admin/structure/yamlform/manage/test_element_plugin_test/submission/' . $sid . '/delete', [], t('Delete'));
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:preDelete');
$this
->assertRaw('Invoked: Drupal\\yamlform_test\\Plugin\\YamlFormElement\\YamlFormTest:postDelete');
$this
->assertRaw('Test: Element: Test (plugin): Submission #' . $yamlform_submission
->serial() . ' has been deleted.');
}
}