From 953e02311cf88bb83db07fe7eae5d366f3d16fe7 Mon Sep 17 00:00:00 2001 From: mattpiwik <matthieu.aubry@gmail.com> Date: Sun, 11 Sep 2011 04:01:55 +0000 Subject: [PATCH] Fixes #2437 Adding test git-svn-id: http://dev.piwik.org/svn/trunk@5147 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- tests/integration/Main.test.php | 6 ++++++ ...SegmentPageTitleMatch__VisitsSummary.get_day.xml | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/integration/expected/test_ecommerceOrderWithItems_SegmentPageTitleMatch__VisitsSummary.get_day.xml diff --git a/tests/integration/Main.test.php b/tests/integration/Main.test.php index 338d5cac82..64897cb20f 100644 --- a/tests/integration/Main.test.php +++ b/tests/integration/Main.test.php @@ -226,6 +226,7 @@ class Test_Piwik_Integration_Main extends Test_Integration $segment = 'visitConvertedGoalId!='.$idGoalStandard; $this->callGetApiCompareOutput(__FUNCTION__ . '_SegmentDidNotConvertGoalId1', 'xml', $idSite, $dateTime, $periods = array('day'), $setDateLastN = false, $language = false, $segment); + // Test segment visitorType $segment = 'visitorType==new'; $this->callGetApiCompareOutput(__FUNCTION__ . '_SegmentNewVisitors', 'xml', $idSite, $dateTime, $periods = array('week'), $setDateLastN = false, $language = false, $segment); $segment = 'visitorType==returning'; @@ -233,6 +234,10 @@ class Test_Piwik_Integration_Main extends Test_Integration $segment = 'visitorType==returningCustomer'; $this->callGetApiCompareOutput(__FUNCTION__ . '_SegmentReturningCustomers', 'xml', $idSite, $dateTime, $periods = array('week'), $setDateLastN = false, $language = false, $segment); + // Test segment pageTitle + $segment = 'pageTitle==incredible%20title!'; + $this->callGetApiCompareOutput(__FUNCTION__ . '_SegmentPageTitleMatch', 'xml', $idSite, $dateTime, $periods = array('day'), $setDateLastN = false, $language = false, $segment); + // test Live! output is OK also for the visit that just bought something (other visits leave an abandoned cart) $this->setApiToCall(array('Live.getLastVisitsDetails')); $this->callGetApiCompareOutput(__FUNCTION__ . '_LiveEcommerceStatusOrdered', 'xml', $idSite, Piwik_Date::factory($dateTime)->addHour( 30.65 )->getDatetime(), $periods = array('day')); @@ -922,6 +927,7 @@ class Test_Piwik_Integration_Main extends Test_Integration 'visitorId!=33c31e01394bdc63', // testing both filter on Actions table and visit table 'visitorId!=33c31e01394bdc63;daysSinceFirstVisit!=50', + //'pageUrl!=http://unknown/not/viewed', ); $dates = array( 'last7', diff --git a/tests/integration/expected/test_ecommerceOrderWithItems_SegmentPageTitleMatch__VisitsSummary.get_day.xml b/tests/integration/expected/test_ecommerceOrderWithItems_SegmentPageTitleMatch__VisitsSummary.get_day.xml new file mode 100644 index 0000000000..aad6714153 --- /dev/null +++ b/tests/integration/expected/test_ecommerceOrderWithItems_SegmentPageTitleMatch__VisitsSummary.get_day.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <nb_visits>1</nb_visits> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_actions>3</nb_actions> + <nb_visits_converted>1</nb_visits_converted> + <bounce_count>0</bounce_count> + <sum_visit_length>720</sum_visit_length> + <max_actions>3</max_actions> + <bounce_rate>0%</bounce_rate> + <nb_actions_per_visit>3</nb_actions_per_visit> + <avg_time_on_site>720</avg_time_on_site> +</result> \ No newline at end of file -- GitLab