class EnhancedEcommerceEventsTest in Commerce Google Tag Manager 8
Same name and namespace in other branches
- 8.2 tests/src/Unit/EnhancedEcommerceEventsTest.php \Drupal\Tests\commerce_google_tag_manager\Unit\EnhancedEcommerceEventsTest
@coversDefaultClass \Drupal\commerce_google_tag_manager\Event\EnhancedEcommerceEvents
@group commerce @group commerce_google_tag_manager @group commerce_google_tag_manager_unit
Hierarchy
- class \Drupal\Tests\UnitTestCase extends \PHPUnit\Framework\TestCase uses PhpunitCompatibilityTrait
- class \Drupal\Tests\commerce_google_tag_manager\Unit\EnhancedEcommerceEventsTest
Expanded class hierarchy of EnhancedEcommerceEventsTest
File
- tests/
src/ Unit/ EnhancedEcommerceEventsTest.php, line 15
Namespace
Drupal\Tests\commerce_google_tag_manager\UnitView source
class EnhancedEcommerceEventsTest extends UnitTestCase {
/**
* @covers \Drupal\commerce_google_tag_manager\Event\EnhancedEcommerceEvents
*
* @dataProvider eventNames
*/
public function testEventNames($event_name, $expected) {
$this
->assertEquals($expected, $event_name);
}
/**
* List of supported event with expected names.
*
* @return array
* The list of CONST names & string expected value.
*/
public function eventNames() {
return [
[
EnhancedEcommerceEvents::ALTER_PRODUCT,
'commerce_google_tag_manager.alter_product',
],
[
EnhancedEcommerceEvents::ALTER_PRODUCT_PURCHASED_ENTITY,
'commerce_google_tag_manager.alter_product_purchased_entity',
],
[
EnhancedEcommerceEvents::ALTER_EVENT_DATA,
'commerce_google_tag_manager.alter_event_data',
],
[
EnhancedEcommerceEvents::TRACK_CHECKOUT_STEP,
'commerce_google_tag_manager.track_checkout_step',
],
];
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EnhancedEcommerceEventsTest:: |
public | function | List of supported event with expected names. | |
EnhancedEcommerceEventsTest:: |
public | function | @covers \Drupal\commerce_google_tag_manager\Event\EnhancedEcommerceEvents | |
PhpunitCompatibilityTrait:: |
public | function | Returns a mock object for the specified class using the available method. | |
PhpunitCompatibilityTrait:: |
public | function | Compatibility layer for PHPUnit 6 to support PHPUnit 4 code. | |
UnitTestCase:: |
protected | property | The random generator. | |
UnitTestCase:: |
protected | property | The app root. | 1 |
UnitTestCase:: |
protected | function | Asserts if two arrays are equal by sorting them first. | |
UnitTestCase:: |
protected | function | Mocks a block with a block plugin. | 1 |
UnitTestCase:: |
protected | function | Returns a stub class resolver. | |
UnitTestCase:: |
public | function | Returns a stub config factory that behaves according to the passed array. | |
UnitTestCase:: |
public | function | Returns a stub config storage that returns the supplied configuration. | |
UnitTestCase:: |
protected | function | Sets up a container with a cache tags invalidator. | |
UnitTestCase:: |
protected | function | Gets the random generator for the utility methods. | |
UnitTestCase:: |
public | function | Returns a stub translation manager that just returns the passed string. | |
UnitTestCase:: |
public | function | Generates a unique random string containing letters and numbers. | |
UnitTestCase:: |
protected | function | 340 |