You are here

protected function EventTest::setup in Webform CiviCRM Integration 8.5

File

tests/src/FunctionalJavascript/EventTest.php, line 15

Class

EventTest
Tests submitting a Webform with CiviCRM: Contact with Event.

Namespace

Drupal\Tests\webform_civicrm\FunctionalJavascript

Code

protected function setup() {
  parent::setUp();
  $ft = $this->utils
    ->wf_civicrm_api('FinancialType', 'get', [
    'return' => [
      "id",
    ],
    'name' => "Event Fee",
  ]);
  $event = $this->utils
    ->wf_civicrm_api('Event', 'create', [
    'event_type_id' => "Conference",
    'title' => "Test Event" . substr(sha1(rand()), 0, 4),
    'start_date' => date('Y-m-d'),
    'financial_type_id' => $ft['id'],
  ]);
  $this
    ->assertEquals(0, $event['is_error']);
  $this
    ->assertEquals(1, $event['count']);
  $this->_event = reset($event['values']);
}