@@ -715,6 +715,26 @@ public function getName(): string
715715 $ class ->toArray ();
716716 }
717717
718+ public function test_exception ()
719+ {
720+
721+ $ event = new Event \Exception ;
722+ $ this ->assertEventNaming ($ event );
723+ $ this ->assertEventFills ($ this ->populateEventByMethod (clone $ event ));
724+ $ this ->assertEventFills ($ this ->populateEventByArrayable (clone $ event ));
725+ $ this ->assertEventFills ($ this ->populateEventByFromArray (clone $ event ));
726+
727+ $ this ->assertImportableByConvertHelper (
728+ [
729+ [ConvertHelper::camel ($ event ->getName ()) => $ this ->populateEventByFromArray (clone $ event )->toArray ()]
730+ ],
731+ $ event
732+ );
733+
734+ $ this ->analytics ->addEvent ($ this ->populateEventByFromArray (clone $ event ));
735+ $ this ->analytics ->post ();
736+ }
737+
718738 protected function assertEventNaming ($ event )
719739 {
720740 $ this ->assertInstanceOf (Type \EventType::class, $ event );
@@ -765,6 +785,9 @@ private function populateEventByFromArray(Type\EventType $event)
765785 'page_title ' => 'Home - Site ' ,
766786 'screen_resolution ' => '1920x1080 ' ,
767787 // ---
788+ 'description ' => "This is a short description " ,
789+ 'fatal ' => true ,
790+ // ---
768791 'currency ' => $ this ->prefill ['currency ' ],
769792 'value ' => 9.99 ,
770793 'affiliation ' => 'affiliation ' ,
@@ -807,6 +830,9 @@ private function populateEventByArrayable(Type\EventType $event)
807830 $ event ['page_title ' ] = 'Home - Site ' ;
808831 $ event ['screen_resolution ' ] = '1920x1080 ' ;
809832
833+ $ event ['description ' ] = 'This is a short description ' ;
834+ $ event ['fatal ' ] = true ;
835+
810836 $ event ['currency ' ] = $ this ->prefill ['currency ' ];
811837 $ event ['value ' ] = 9.99 ;
812838 $ event ['affiliation ' ] = 'affiliation ' ;
@@ -843,7 +869,7 @@ private function populateEventByArrayable(Type\EventType $event)
843869 }
844870
845871 private function populateEventByMethod (
846- Type \EventType |Group \AddPaymentInfoFacade |Group \AddShippingInfoFacade |Group \AddToCartFacade |Group \AddToWishlistFacade |Group \AnalyticsFacade |Group \BeginCheckoutFacade |Group \EarnVirtualCurrencyFacade |Group \ExportFacade |Group \GenerateLeadFacade |Group \ItemFacade |Group \JoinGroupFacade |Group \LevelUpFacade |Group \LoginFacade |Group \PostScoreFacade |Group \PurchaseFacade |Group \RefundFacade |Group \RemoveFromCartFacade |Group \SearchFacade |Group \SelectContentFacade |Group \SelectItemFacade |Group \SelectPromotionFacade |Group \ShareFacade |Group \SignUpFacade |Group \SpendVirtualCurrencyFacade |Group \UnlockAchievementFacade |Group \ViewCartFacade |Group \ViewItemFacade |Group \ViewItemListFacade |Group \ViewPromotionFacade |Group \ViewSearchResultsFacade |Group \hasItemsFacade $ event
872+ Type \EventType |Group \ExceptionFacade | Group \ AddPaymentInfoFacade |Group \AddShippingInfoFacade |Group \AddToCartFacade |Group \AddToWishlistFacade |Group \AnalyticsFacade |Group \BeginCheckoutFacade |Group \EarnVirtualCurrencyFacade |Group \ExportFacade |Group \GenerateLeadFacade |Group \ItemFacade |Group \JoinGroupFacade |Group \LevelUpFacade |Group \LoginFacade |Group \PostScoreFacade |Group \PurchaseFacade |Group \RefundFacade |Group \RemoveFromCartFacade |Group \SearchFacade |Group \SelectContentFacade |Group \SelectItemFacade |Group \SelectPromotionFacade |Group \ShareFacade |Group \SignUpFacade |Group \SpendVirtualCurrencyFacade |Group \UnlockAchievementFacade |Group \ViewCartFacade |Group \ViewItemFacade |Group \ViewItemListFacade |Group \ViewPromotionFacade |Group \ViewSearchResultsFacade |Group \hasItemsFacade $ event
847873 ) {
848874 $ params = $ event ->getAllParams ();
849875
@@ -853,6 +879,13 @@ private function populateEventByMethod(
853879 $ event ->setPageTitle ('Home - Site ' );
854880 $ event ->setScreenResolution ('1920x1080 ' );
855881
882+ if (in_array ('description ' , $ params )) {
883+ $ event ->setDescription ("This is a short description " );
884+ if (in_array ('fatal ' , $ params )) {
885+ $ event ->setFatal (1 );
886+ }
887+ }
888+
856889 if (in_array ('currency ' , $ params )) {
857890 $ event ->setCurrency ($ this ->prefill ['currency ' ]);
858891 if (in_array ('value ' , $ params )) {
0 commit comments