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