GenericTest.php in Googalytics - Google Analytics 8
File
tests/src/Unit/AnalyticsCommand/GenericTest.php
View source
<?php
namespace Drupal\Tests\ga\Unit\AnalyticsCommand;
use Drupal\ga\AnalyticsCommand\Generic;
use Drupal\Tests\UnitTestCase;
class GenericTest extends UnitTestCase {
public function testDefaultPriority() {
$command = new Generic('commandName');
$this
->assertEquals(0, $command
->getPriority());
}
public function testBasicSettingCommands() {
$command = new Generic('commandName');
$this
->assertEquals([
[
'commandName',
],
], $command
->getSettingCommands());
}
public function testWithFieldsObjectSettingCommmands() {
$command = new Generic('commandName', [
'field1' => 'value1',
]);
$this
->assertEquals([
[
'commandName',
[
'field1' => 'value1',
],
],
], $command
->getSettingCommands());
}
public function testWithTrackerNameSettingCommands() {
$command = new Generic('commandName', [], 'tracker');
$this
->assertEquals([
[
'tracker.commandName',
],
], $command
->getSettingCommands());
}
}