Skip to content

Commit 8a3a7e2

Browse files
author
Alex Westergaard
committed
Add test of expected request (dump&die)
1 parent 986965f commit 8a3a7e2

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/Unit/HelperTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,31 @@ public function test_convert_helper_transforms_array_into_events()
2626
$this->assertCount(2, $this->analytics['events']);
2727
}
2828

29+
public function test_convert_helper_transforms_events_with_items()
30+
{
31+
$request = [
32+
[
33+
'AddToCart' => [
34+
'currency' => 'AUD',
35+
'value' => 38,
36+
'items' => [
37+
[
38+
'item_id' => 29,
39+
'item_name' => '500g Musk Scrolls',
40+
'price' => 38,
41+
'quantity' => 1,
42+
],
43+
],
44+
],
45+
],
46+
];
47+
48+
$list = Helper\ConvertHelper::parseEvents($request);
49+
50+
var_dump($request, $list);
51+
exit;
52+
}
53+
2954
public function test_snakecase_helper_transforms_camelcase_names()
3055
{
3156
$output = Helper\ConvertHelper::snake('snakeCase');

0 commit comments

Comments
 (0)