WebformHandlerConditionsTest.php in Webform 8.5
File
tests/src/Functional/Handler/WebformHandlerConditionsTest.php
View source
<?php
namespace Drupal\Tests\webform\Functional\Handler;
use Drupal\webform\Entity\Webform;
use Drupal\Tests\webform\Functional\WebformBrowserTestBase;
class WebformHandlerConditionsTest extends WebformBrowserTestBase {
public static $modules = [
'webform',
'webform_test_handler',
];
protected static $testWebforms = [
'test_handler_conditions',
];
public function testConditions() {
$this
->drupalLogin($this->rootUser);
$webform = Webform::load('test_handler_conditions');
$this
->drupalGet('/webform/test_handler_conditions');
$this
->assertRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:preCreate');
$this
->assertRaw('Invoked test_b: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:preCreate');
$this
->assertRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:alterElements');
$this
->assertRaw('Invoked test_b: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:alterElements');
$this
->postSubmission($webform);
$this
->assertRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:preCreate');
$this
->assertRaw('Invoked test_b: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:preCreate');
$this
->assertRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:alterElements');
$this
->assertRaw('Invoked test_b: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:alterElements');
$this
->postSubmission($webform, [
'trigger_a' => TRUE,
]);
$this
->assertRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:preCreate');
$this
->assertRaw('Invoked test_b: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:preCreate');
$this
->assertRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:alterElements');
$this
->assertRaw('Invoked test_b: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:alterElements');
$this
->assertRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:validateForm');
$this
->assertRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:submitForm');
$this
->assertRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:preSave');
$this
->assertRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:postSave insert');
$this
->assertRaw('Test A');
$this
->assertRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:confirmForm');
$this
->postSubmission($webform, [
'trigger_b' => TRUE,
]);
$this
->assertRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:preCreate');
$this
->assertRaw('Invoked test_b: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:preCreate');
$this
->assertRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:alterElements');
$this
->assertRaw('Invoked test_b: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:alterElements');
$this
->assertNoRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:validateForm');
$this
->assertNoRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:submitForm');
$this
->assertNoRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:preSave');
$this
->assertNoRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:postSave insert');
$this
->assertNoRaw('Test A');
$this
->assertNoRaw('Invoked test_a: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:confirmForm');
$this
->assertRaw('Invoked test_b: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:validateForm');
$this
->assertRaw('Invoked test_b: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:submitForm');
$this
->assertRaw('Invoked test_b: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:preSave');
$this
->assertRaw('Invoked test_b: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:postSave insert');
$this
->assertRaw('Test B');
$this
->assertRaw('Invoked test_b: Drupal\\webform_test_handler\\Plugin\\WebformHandler\\TestWebformHandler:confirmForm');
}
}