Skip to content

Commit 65154ae

Browse files
committed
update tests and remove test for removed class
1 parent c88fcc8 commit 65154ae

File tree

3 files changed

+34
-53
lines changed

3 files changed

+34
-53
lines changed

test/Unit/ConsentTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function test_consent_granted_posted()
7575
$this->assertArrayHasKey("ad_personalization", $export);
7676
$this->assertEquals(ConsentHelper::GRANTED, $export["ad_user_data"]);
7777
$this->assertEquals(ConsentHelper::GRANTED, $export["ad_personalization"]);
78-
$this->assertNull($this->analytics->post());
78+
$this->analytics->post();
7979
}
8080

8181
public function test_consent_ad_user_data_denied()
@@ -136,6 +136,6 @@ public function test_consent_denied_posted()
136136
$this->assertArrayHasKey("ad_personalization", $export);
137137
$this->assertEquals(ConsentHelper::DENIED, $export["ad_user_data"]);
138138
$this->assertEquals(ConsentHelper::DENIED, $export["ad_personalization"]);
139-
$this->assertNull($this->analytics->post());
139+
$this->analytics->post();
140140
}
141141
}

test/Unit/EventTest.php

Lines changed: 30 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,6 @@
1515

1616
final class EventTest extends MeasurementTestCase
1717
{
18-
public function test_pageview()
19-
{
20-
$event = new Event\PageView;
21-
22-
$this->assertEventNaming($event);
23-
$this->assertEventFills($this->populateEventByMethod(clone $event));
24-
$this->assertEventFills($this->populateEventByArrayable(clone $event));
25-
$this->assertEventFills($this->populateEventByFromArray(clone $event));
26-
27-
$this->assertImportableByConvertHelper(
28-
[
29-
[ConvertHelper::camel($event->getName()) => $this->populateEventByFromArray(clone $event)->toArray()]
30-
],
31-
$event
32-
);
33-
34-
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
35-
$this->assertNull($this->analytics->post());
36-
}
37-
3818
public function test_addpaymentinfo()
3919
{
4020
$event = new Event\AddPaymentInfo;
@@ -52,7 +32,7 @@ public function test_addpaymentinfo()
5232
);
5333

5434
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
55-
$this->assertNull($this->analytics->post());
35+
$this->analytics->post();
5636
}
5737

5838
public function test_addshippinginfo()
@@ -71,7 +51,7 @@ public function test_addshippinginfo()
7151
);
7252

7353
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
74-
$this->assertNull($this->analytics->post());
54+
$this->analytics->post();
7555
}
7656

7757
public function test_addtocart()
@@ -90,7 +70,7 @@ public function test_addtocart()
9070
);
9171

9272
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
93-
$this->assertNull($this->analytics->post());
73+
$this->analytics->post();
9474
}
9575

9676
public function test_addtowishlist()
@@ -109,7 +89,7 @@ public function test_addtowishlist()
10989
);
11090

11191
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
112-
$this->assertNull($this->analytics->post());
92+
$this->analytics->post();
11393
}
11494

11595
public function test_begincheckout()
@@ -128,7 +108,7 @@ public function test_begincheckout()
128108
);
129109

130110
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
131-
$this->assertNull($this->analytics->post());
111+
$this->analytics->post();
132112
}
133113

134114
public function test_earnvirtualcurrency()
@@ -147,7 +127,7 @@ public function test_earnvirtualcurrency()
147127
);
148128

149129
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
150-
$this->assertNull($this->analytics->post());
130+
$this->analytics->post();
151131
}
152132

153133
public function test_generatelead()
@@ -166,7 +146,7 @@ public function test_generatelead()
166146
);
167147

168148
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
169-
$this->assertNull($this->analytics->post());
149+
$this->analytics->post();
170150
}
171151

172152
public function test_joingroup()
@@ -185,7 +165,7 @@ public function test_joingroup()
185165
);
186166

187167
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
188-
$this->assertNull($this->analytics->post());
168+
$this->analytics->post();
189169
}
190170

191171
public function test_levelup()
@@ -205,7 +185,7 @@ public function test_levelup()
205185
);
206186

207187
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
208-
$this->assertNull($this->analytics->post());
188+
$this->analytics->post();
209189
}
210190
public function test_login()
211191
{
@@ -223,7 +203,7 @@ public function test_login()
223203
);
224204

225205
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
226-
$this->assertNull($this->analytics->post());
206+
$this->analytics->post();
227207
}
228208

229209
public function test_postscore()
@@ -242,7 +222,7 @@ public function test_postscore()
242222
);
243223

244224
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
245-
$this->assertNull($this->analytics->post());
225+
$this->analytics->post();
246226
}
247227

248228
public function test_purchase()
@@ -261,7 +241,7 @@ public function test_purchase()
261241
);
262242

263243
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
264-
$this->assertNull($this->analytics->post());
244+
$this->analytics->post();
265245
}
266246

267247
public function test_refund()
@@ -280,7 +260,7 @@ public function test_refund()
280260
);
281261

282262
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
283-
$this->assertNull($this->analytics->post());
263+
$this->analytics->post();
284264
}
285265

286266
public function test_refund_full_succeeds_without_items()
@@ -289,7 +269,7 @@ public function test_refund_full_succeeds_without_items()
289269

290270
$this->analytics->addEvent($refund);
291271

292-
$this->assertNull($this->analytics->post());
272+
$this->analytics->post();
293273
}
294274

295275
public function test_refund_partial_succeeds_with_items()
@@ -333,7 +313,7 @@ public function test_removefromcart()
333313
);
334314

335315
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
336-
$this->assertNull($this->analytics->post());
316+
$this->analytics->post();
337317
}
338318

339319
public function test_search()
@@ -352,7 +332,7 @@ public function test_search()
352332
);
353333

354334
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
355-
$this->assertNull($this->analytics->post());
335+
$this->analytics->post();
356336
}
357337

358338
public function test_selectcontent()
@@ -371,7 +351,7 @@ public function test_selectcontent()
371351
);
372352

373353
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
374-
$this->assertNull($this->analytics->post());
354+
$this->analytics->post();
375355
}
376356

377357
public function test_selectitem()
@@ -390,7 +370,7 @@ public function test_selectitem()
390370
);
391371

392372
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
393-
$this->assertNull($this->analytics->post());
373+
$this->analytics->post();
394374
}
395375

396376
public function test_selectpromotion()
@@ -409,7 +389,7 @@ public function test_selectpromotion()
409389
);
410390

411391
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
412-
$this->assertNull($this->analytics->post());
392+
$this->analytics->post();
413393
}
414394

415395
public function test_share()
@@ -428,7 +408,7 @@ public function test_share()
428408
);
429409

430410
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
431-
$this->assertNull($this->analytics->post());
411+
$this->analytics->post();
432412
}
433413

434414
public function test_signup()
@@ -447,7 +427,7 @@ public function test_signup()
447427
);
448428

449429
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
450-
$this->assertNull($this->analytics->post());
430+
$this->analytics->post();
451431
}
452432

453433
public function test_spendvirtualcurrency()
@@ -466,7 +446,7 @@ public function test_spendvirtualcurrency()
466446
);
467447

468448
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
469-
$this->assertNull($this->analytics->post());
449+
$this->analytics->post();
470450
}
471451

472452
public function test_tutorialbegin()
@@ -485,7 +465,7 @@ public function test_tutorialbegin()
485465
);
486466

487467
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
488-
$this->assertNull($this->analytics->post());
468+
$this->analytics->post();
489469
}
490470

491471
public function test_tutorialcomplete()
@@ -504,7 +484,7 @@ public function test_tutorialcomplete()
504484
);
505485

506486
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
507-
$this->assertNull($this->analytics->post());
487+
$this->analytics->post();
508488
}
509489

510490
public function test_unlockachievement()
@@ -523,7 +503,7 @@ public function test_unlockachievement()
523503
);
524504

525505
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
526-
$this->assertNull($this->analytics->post());
506+
$this->analytics->post();
527507
}
528508

529509
public function test_biewcart()
@@ -542,7 +522,7 @@ public function test_biewcart()
542522
);
543523

544524
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
545-
$this->assertNull($this->analytics->post());
525+
$this->analytics->post();
546526
}
547527

548528
public function test_viewitem()
@@ -561,7 +541,7 @@ public function test_viewitem()
561541
);
562542

563543
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
564-
$this->assertNull($this->analytics->post());
544+
$this->analytics->post();
565545
}
566546

567547
public function test_viewitemlist()
@@ -580,7 +560,7 @@ public function test_viewitemlist()
580560
);
581561

582562
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
583-
$this->assertNull($this->analytics->post());
563+
$this->analytics->post();
584564
}
585565

586566
public function test_viewpromotion()
@@ -599,7 +579,7 @@ public function test_viewpromotion()
599579
);
600580

601581
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
602-
$this->assertNull($this->analytics->post());
582+
$this->analytics->post();
603583
}
604584

605585
public function test_viewsearchresults()
@@ -618,7 +598,7 @@ public function test_viewsearchresults()
618598
);
619599

620600
$this->analytics->addEvent($this->populateEventByFromArray(clone $event));
621-
$this->assertNull($this->analytics->post());
601+
$this->analytics->post();
622602
}
623603

624604
public function test_throw_name_missing()

test/Unit/UserDataTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function test_user_data_is_fillable()
3636
$this->assertEquals($setPostalCode, $export["address"]["postal_code"], $setPostalCode);
3737
$this->assertEquals($setCountry, $export["address"]["country"], $setCountry);
3838
}
39+
3940
public function test_user_data_is_sendable()
4041
{
4142
$uad = $this->analytics->userdata();
@@ -50,6 +51,6 @@ public function test_user_data_is_sendable()
5051
$uad->setCountry("DK");
5152

5253
$this->analytics->addEvent(Login::new());
53-
$this->assertNull($this->analytics->post());
54+
$this->analytics->post();
5455
}
5556
}

0 commit comments

Comments
 (0)