You are here

public function MetricTest::testStringIndexFloatStringValue in Googalytics - Google Analytics 8

Test a valid index and value of type string.

Decimal value should be cast as float so decimal is retained.

File

tests/src/Unit/AnalyticsCommand/MetricTest.php, line 39

Class

MetricTest
@coversDefaultClass \Drupal\ga\AnalyticsCommand\Metric @group ga

Namespace

Drupal\Tests\ga\Unit\AnalyticsCommand

Code

public function testStringIndexFloatStringValue() {
  $command = new Metric('42', '123.45');
  $this
    ->assertEquals([
    [
      'set',
      'metric42',
      123.45,
    ],
  ], $command
    ->getSettingCommands());
}