You are here

public function CreateTest::testWithFieldsObjectSettingCommmands in Googalytics - Google Analytics 8

Test the command array when values are provided in fieldsObject.

File

tests/src/Unit/AnalyticsCommand/CreateTest.php, line 44

Class

CreateTest
@coversDefaultClass \Drupal\ga\AnalyticsCommand\Create @group ga

Namespace

Drupal\Tests\ga\Unit\AnalyticsCommand

Code

public function testWithFieldsObjectSettingCommmands() {
  $command = new Create('UA-12345678-1', 'auto', NULL, [
    'field1' => 'value1',
  ]);
  $this
    ->assertEquals([
    [
      'create',
      'UA-12345678-1',
      'auto',
      [
        'field1' => 'value1',
      ],
    ],
  ], $command
    ->getSettingCommands());
}