You are here

protected function YamlFormTestTrait::getLastSubmissionId in YAML Form 8

Get the last submission id.

Return value

int The last submission id.

7 calls to YamlFormTestTrait::getLastSubmissionId()
YamlFormHandlerEmailAdvancedTest::testAdvancedEmailHandler in src/Tests/YamlFormHandlerEmailAdvancedTest.php
Test advanced email handler.
YamlFormNodeAccessTest::testAccessRules in modules/yamlform_node/src/Tests/YamlFormNodeAccessTest.php
Tests form node access rules.
YamlFormNodeResultsTest::testResults in modules/yamlform_node/src/Tests/YamlFormNodeResultsTest.php
Tests form node results.
YamlFormNodeTest::testNode in modules/yamlform_node/src/Tests/YamlFormNodeTest.php
Tests form node.
YamlFormSubmissionFormSettingsTest::testSettings in src/Tests/YamlFormSubmissionFormSettingsTest.php
Tests form setting including confirmation.

... See full list

File

src/Tests/YamlFormTestTrait.php, line 192

Class

YamlFormTestTrait
Defines form test trait.

Namespace

Drupal\yamlform\Tests

Code

protected function getLastSubmissionId($yamlform) {

  // Get submission sid.
  $url = UrlHelper::parse($this
    ->getUrl());
  if (isset($url['query']['sid'])) {
    return $url['query']['sid'];
  }
  else {
    $entity_ids = \Drupal::entityQuery('yamlform_submission')
      ->sort('sid', 'DESC')
      ->condition('yamlform_id', $yamlform
      ->id())
      ->execute();
    return reset($entity_ids);
  }
}